Skip to content

Commit 9200fb9

Browse files
authored
[Feature] Customize and document event_log block in databricks_pipeline (#4612)
## Changes <!-- Summary of your changes that are easy to understand --> The only required parameter is `event_log.name`, the `catalog` and `schema` are inherited from the pipeline settings. ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] `make test` run locally - [x] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [ ] using Go SDK - [ ] using TF Plugin Framework
1 parent 06b6938 commit 9200fb9

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### New Features and Improvements
66

7+
* Customize and document `event_log` block in `databricks_pipeline` ([#4612](https://github.com/databricks/terraform-provider-databricks/pull/4612))
78
* Add automatic clustering support for `databricks_sql_table` ([#4607](https://github.com/databricks/terraform-provider-databricks/pull/4607))
89

910
### Bug Fixes

docs/resources/pipeline.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ The following arguments are supported:
9797
* `gateway_storage_catalog` - Required, Immutable. The name of the catalog for the gateway pipeline's storage location.
9898
* `gateway_storage_name` - Required. The Unity Catalog-compatible naming for the gateway storage location. This is the destination to use for the data that is extracted by the gateway. Delta Live Tables system will automatically create the storage location under the catalog and schema.
9999
* `gateway_storage_schema` - Required, Immutable. The name of the schema for the gateway pipelines's storage location.
100-
100+
* `event_log` - an optional block specifying a table where DLT Event Log will be stored. Consists of the following fields:
101+
* `name` - (Required) The table name the event log is published to in UC.
102+
* `catalog` - (Optional, default to `catalog` defined on pipeline level) The UC catalog the event log is published under.
103+
* `schema` - (Optional, default to `schema` defined on pipeline level) The UC schema the event log is published under.
101104

102105
### notification block
103106

pipelines/resource_pipeline.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,21 +213,19 @@ func (Pipeline) CustomizeSchema(s *common.CustomizableSchema) *common.Customizab
213213
s.SchemaPath("ingestion_definition", "ingestion_gateway_id").SetForceNew()
214214

215215
// Computed fields
216-
s.SchemaPath("id").SetComputed()
217216
s.SchemaPath("cluster", "node_type_id").SetComputed()
218217
s.SchemaPath("cluster", "driver_node_type_id").SetComputed()
219218
s.SchemaPath("cluster", "enable_local_disk_encryption").SetComputed()
220-
s.SchemaPath("url").SetComputed()
221-
222-
s.SchemaPath("state").SetComputed()
223-
s.SchemaPath("latest_updates").SetComputed()
224-
s.SchemaPath("last_modified").SetComputed()
225-
s.SchemaPath("health").SetComputed()
226-
s.SchemaPath("cause").SetComputed()
227-
s.SchemaPath("cluster_id").SetComputed()
228-
s.SchemaPath("creator_user_name").SetComputed()
229-
s.SchemaPath("run_as").SetComputed()
230-
s.SchemaPath("run_as_user_name").SetReadOnly()
219+
220+
for _, field := range []string{"id", "state", "latest_updates", "last_modified",
221+
"health", "cause", "cluster_id", "creator_user_name", "run_as", "url", "run_as_user_name"} {
222+
s.SchemaPath(field).SetComputed()
223+
}
224+
225+
// customize event_log
226+
s.SchemaPath("event_log", "name").SetRequired()
227+
s.SchemaPath("event_log", "catalog").SetComputed()
228+
s.SchemaPath("event_log", "schema").SetComputed()
231229

232230
// SuppressDiff fields
233231
s.SchemaPath("edition").SetSuppressDiff()

0 commit comments

Comments
 (0)