diff --git a/.gitattributes b/.gitattributes index 5e5dc235b..e94cfcd7b 100755 --- a/.gitattributes +++ b/.gitattributes @@ -83,3 +83,6 @@ cmd/workspace/warehouses/warehouses.go linguist-generated=true cmd/workspace/workspace-bindings/workspace-bindings.go linguist-generated=true cmd/workspace/workspace-conf/workspace-conf.go linguist-generated=true cmd/workspace/workspace/workspace.go linguist-generated=true + +# Hide diff for Go structs generated from databricks terraform provider schema +bundle/internal/tf/schema/*.go linguist-generated=true diff --git a/bundle/internal/tf/codegen/README.md b/bundle/internal/tf/codegen/README.md index fce447cf9..b1f8a33a8 100644 --- a/bundle/internal/tf/codegen/README.md +++ b/bundle/internal/tf/codegen/README.md @@ -13,3 +13,9 @@ Run with: ```go go run . ``` + +How to regenerate Go structs from an updated terraform provider? +1. Bump version in ./schema/version.go +2. Delete `./tmp` if it exists +3. Run `go run .` +4. Run `gofmt -s -w ../schema` diff --git a/bundle/internal/tf/codegen/schema/version.go b/bundle/internal/tf/codegen/schema/version.go index c82218fc3..3269a9719 100644 --- a/bundle/internal/tf/codegen/schema/version.go +++ b/bundle/internal/tf/codegen/schema/version.go @@ -1,3 +1,3 @@ package schema -const ProviderVersion = "1.28.0" +const ProviderVersion = "1.29.0" diff --git a/bundle/internal/tf/codegen/templates/root.go.tmpl b/bundle/internal/tf/codegen/templates/root.go.tmpl index 5530427c7..57fa71299 100644 --- a/bundle/internal/tf/codegen/templates/root.go.tmpl +++ b/bundle/internal/tf/codegen/templates/root.go.tmpl @@ -1,3 +1,4 @@ +// Generated from Databricks Terraform provider schema. DO NOT EDIT. package schema type Providers struct { diff --git a/bundle/internal/tf/schema/data_source_job.go b/bundle/internal/tf/schema/data_source_job.go index 569c8b810..49be8f013 100644 --- a/bundle/internal/tf/schema/data_source_job.go +++ b/bundle/internal/tf/schema/data_source_job.go @@ -24,6 +24,11 @@ type DataSourceJobJobSettingsSettingsDbtTask struct { WarehouseId string `json:"warehouse_id,omitempty"` } +type DataSourceJobJobSettingsSettingsDeployment struct { + Kind string `json:"kind"` + MetadataFilePath string `json:"metadata_file_path,omitempty"` +} + type DataSourceJobJobSettingsSettingsEmailNotifications struct { AlertOnLastAttempt bool `json:"alert_on_last_attempt,omitempty"` NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` @@ -848,6 +853,7 @@ type DataSourceJobJobSettingsSettings struct { Compute []DataSourceJobJobSettingsSettingsCompute `json:"compute,omitempty"` Continuous *DataSourceJobJobSettingsSettingsContinuous `json:"continuous,omitempty"` DbtTask *DataSourceJobJobSettingsSettingsDbtTask `json:"dbt_task,omitempty"` + Deployment *DataSourceJobJobSettingsSettingsDeployment `json:"deployment,omitempty"` EmailNotifications *DataSourceJobJobSettingsSettingsEmailNotifications `json:"email_notifications,omitempty"` GitSource *DataSourceJobJobSettingsSettingsGitSource `json:"git_source,omitempty"` Health *DataSourceJobJobSettingsSettingsHealth `json:"health,omitempty"` diff --git a/bundle/internal/tf/schema/resource_artifact_allowlist.go b/bundle/internal/tf/schema/resource_artifact_allowlist.go new file mode 100644 index 000000000..e2629ac1e --- /dev/null +++ b/bundle/internal/tf/schema/resource_artifact_allowlist.go @@ -0,0 +1,17 @@ +// Generated from Databricks Terraform provider schema. DO NOT EDIT. + +package schema + +type ResourceArtifactAllowlistArtifactMatcher struct { + Artifact string `json:"artifact"` + MatchType string `json:"match_type"` +} + +type ResourceArtifactAllowlist struct { + ArtifactType string `json:"artifact_type"` + CreatedAt int `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + Id string `json:"id,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + ArtifactMatcher []ResourceArtifactAllowlistArtifactMatcher `json:"artifact_matcher,omitempty"` +} diff --git a/bundle/internal/tf/schema/resource_job.go b/bundle/internal/tf/schema/resource_job.go index 7af075609..b4a33bdf1 100644 --- a/bundle/internal/tf/schema/resource_job.go +++ b/bundle/internal/tf/schema/resource_job.go @@ -24,6 +24,11 @@ type ResourceJobDbtTask struct { WarehouseId string `json:"warehouse_id,omitempty"` } +type ResourceJobDeployment struct { + Kind string `json:"kind"` + MetadataFilePath string `json:"metadata_file_path,omitempty"` +} + type ResourceJobEmailNotifications struct { AlertOnLastAttempt bool `json:"alert_on_last_attempt,omitempty"` NoAlertForSkippedRuns bool `json:"no_alert_for_skipped_runs,omitempty"` @@ -852,6 +857,7 @@ type ResourceJob struct { Compute []ResourceJobCompute `json:"compute,omitempty"` Continuous *ResourceJobContinuous `json:"continuous,omitempty"` DbtTask *ResourceJobDbtTask `json:"dbt_task,omitempty"` + Deployment *ResourceJobDeployment `json:"deployment,omitempty"` EmailNotifications *ResourceJobEmailNotifications `json:"email_notifications,omitempty"` GitSource *ResourceJobGitSource `json:"git_source,omitempty"` Health *ResourceJobHealth `json:"health,omitempty"` diff --git a/bundle/internal/tf/schema/resource_sql_table.go b/bundle/internal/tf/schema/resource_sql_table.go index 077645c2f..97a8977bc 100644 --- a/bundle/internal/tf/schema/resource_sql_table.go +++ b/bundle/internal/tf/schema/resource_sql_table.go @@ -12,15 +12,19 @@ type ResourceSqlTableColumn struct { type ResourceSqlTable struct { CatalogName string `json:"catalog_name"` ClusterId string `json:"cluster_id,omitempty"` + ClusterKeys []string `json:"cluster_keys,omitempty"` Comment string `json:"comment,omitempty"` DataSourceFormat string `json:"data_source_format,omitempty"` Id string `json:"id,omitempty"` Name string `json:"name"` + Options map[string]string `json:"options,omitempty"` + Partitions []string `json:"partitions,omitempty"` Properties map[string]string `json:"properties,omitempty"` SchemaName string `json:"schema_name"` StorageCredentialName string `json:"storage_credential_name,omitempty"` StorageLocation string `json:"storage_location,omitempty"` TableType string `json:"table_type"` ViewDefinition string `json:"view_definition,omitempty"` + WarehouseId string `json:"warehouse_id,omitempty"` Column []ResourceSqlTableColumn `json:"column,omitempty"` } diff --git a/bundle/internal/tf/schema/resources.go b/bundle/internal/tf/schema/resources.go index cf98f9a91..9a04be7ea 100644 --- a/bundle/internal/tf/schema/resources.go +++ b/bundle/internal/tf/schema/resources.go @@ -4,6 +4,7 @@ package schema type Resources struct { AccessControlRuleSet map[string]*ResourceAccessControlRuleSet `json:"databricks_access_control_rule_set,omitempty"` + ArtifactAllowlist map[string]*ResourceArtifactAllowlist `json:"databricks_artifact_allowlist,omitempty"` AwsS3Mount map[string]*ResourceAwsS3Mount `json:"databricks_aws_s3_mount,omitempty"` AzureAdlsGen1Mount map[string]*ResourceAzureAdlsGen1Mount `json:"databricks_azure_adls_gen1_mount,omitempty"` AzureAdlsGen2Mount map[string]*ResourceAzureAdlsGen2Mount `json:"databricks_azure_adls_gen2_mount,omitempty"` @@ -87,6 +88,7 @@ type Resources struct { func NewResources() *Resources { return &Resources{ AccessControlRuleSet: make(map[string]*ResourceAccessControlRuleSet), + ArtifactAllowlist: make(map[string]*ResourceArtifactAllowlist), AwsS3Mount: make(map[string]*ResourceAwsS3Mount), AzureAdlsGen1Mount: make(map[string]*ResourceAzureAdlsGen1Mount), AzureAdlsGen2Mount: make(map[string]*ResourceAzureAdlsGen2Mount), diff --git a/bundle/internal/tf/schema/root.go b/bundle/internal/tf/schema/root.go index 74f4db1a2..3ad8cf4d1 100644 --- a/bundle/internal/tf/schema/root.go +++ b/bundle/internal/tf/schema/root.go @@ -1,3 +1,4 @@ +// Generated from Databricks Terraform provider schema. DO NOT EDIT. package schema type Providers struct { @@ -24,7 +25,7 @@ func NewRoot() *Root { "required_providers": map[string]interface{}{ "databricks": map[string]interface{}{ "source": "databricks/databricks", - "version": "1.28.0", + "version": "1.29.0", }, }, },