From 66092df41d25ec0b8a9e78c905fb00341d636caa Mon Sep 17 00:00:00 2001 From: Alex Ott Date: Wed, 3 Dec 2025 09:29:07 +0100 Subject: [PATCH] [Feature] Handle new fields in `databricks_pipeline` resource Changes include: - Added documentation for new fields - ForceNew for new fields --- NEXT_CHANGELOG.md | 1 + docs/resources/pipeline.md | 4 +++- pipelines/resource_pipeline.go | 13 ++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 34433a44bf..ec86f9a975 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -10,6 +10,7 @@ * Add `databricks_users` data source ([#4028](https://github.com/databricks/terraform-provider-databricks/pull/4028)) * Improve `databricks_service_principals` data source ([#5164](https://github.com/databricks/terraform-provider-databricks/pull/5164)) * Add `feature_engineering_kafka_config` resource and data source ([#5240](https://github.com/databricks/terraform-provider-databricks/pull/5240)) +* Handle new fields in `databricks_pipeline` resource ([#5249](https://github.com/databricks/terraform-provider-databricks/pull/5249)) ### Bug Fixes diff --git a/docs/resources/pipeline.md b/docs/resources/pipeline.md index ebf4c427c1..ad4cc7850a 100644 --- a/docs/resources/pipeline.md +++ b/docs/resources/pipeline.md @@ -104,7 +104,8 @@ The following arguments are supported: * `include` - Paths to include. * `exclude` - Paths to exclude. * `gateway_definition` - The definition of a gateway pipeline to support CDC. Consists of following attributes: - * `connection_id` - Immutable. The Unity Catalog connection this gateway pipeline uses to communicate with the source. + * `connection_id` - Deprecated, Immutable. The Unity Catalog connection this gateway pipeline uses to communicate with the source. *Use `connection_name` instead!* + * `connection_name` - Immutable. The Unity Catalog connection that this gateway pipeline uses to communicate with the source. * `gateway_storage_catalog` - Required, Immutable. The name of the catalog for the gateway pipeline's storage location. * `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. Lakeflow Declarative Pipelines system will automatically create the storage location under the catalog and schema. * `gateway_storage_schema` - Required, Immutable. The name of the schema for the gateway pipelines's storage location. @@ -167,6 +168,7 @@ The configuration for a managed ingestion pipeline. These settings cannot be use * `connection_name` - Immutable. The Unity Catalog connection this ingestion pipeline uses to communicate with the source. Specify either ingestion_gateway_id or connection_name. * `ingestion_gateway_id` - Immutable. Identifier for the ingestion gateway used by this ingestion pipeline to communicate with the source. Specify either ingestion_gateway_id or connection_name. * `objects` - Required. Settings specifying tables to replicate and the destination for the replicated tables. +* `source_configurations` - Array of objects describing top-level source configurations. See the [REST API docs](https://docs.databricks.com/api/workspace/pipelines/create#ingestion_definition-source_configurations) for reference. * `table_configuration` - Configuration settings to control the ingestion of tables. These settings are applied to all tables in the pipeline. ## Attribute Reference diff --git a/pipelines/resource_pipeline.go b/pipelines/resource_pipeline.go index 4c2d9ec66b..209731e6c7 100644 --- a/pipelines/resource_pipeline.go +++ b/pipelines/resource_pipeline.go @@ -200,11 +200,14 @@ func (Pipeline) CustomizeSchema(s *common.CustomizableSchema) *common.Customizab s.SchemaPath("storage").SetForceNew() // catalog can be updated in-place, but switching between storage and catalog requires recreation // (handled in CustomizeDiff) - s.SchemaPath("gateway_definition", "connection_id").SetForceNew() - s.SchemaPath("gateway_definition", "gateway_storage_catalog").SetForceNew() - s.SchemaPath("gateway_definition", "gateway_storage_schema").SetForceNew() - s.SchemaPath("ingestion_definition", "connection_name").SetForceNew() - s.SchemaPath("ingestion_definition", "ingestion_gateway_id").SetForceNew() + for _, field := range []string{"connection_id", "connection_name", + "gateway_storage_catalog", "gateway_storage_schema"} { + s.SchemaPath("gateway_definition", field).SetForceNew() + } + for _, field := range []string{"connection_name", "ingestion_gateway_id", + "ingest_from_uc_foreign_catalog"} { + s.SchemaPath("ingestion_definition", field).SetForceNew() + } // Required fields s.SchemaPath("library", "glob", "include").SetRequired()