Skip to content

Commit

Permalink
Upgrade TF provider to 1.58.0 (#1900)
Browse files Browse the repository at this point in the history
## Changes

Notable changes:
* Adds support for `restart_window` for pipelines.
* Fix drift for pipelines where `catalog` contains uppercase characters.
* Better error message if single-node job clusters are incorrectly configured.

See:
* https://github.com/databricks/terraform-provider-databricks/releases/tag/v1.58.0
* https://github.com/databricks/terraform-provider-databricks/releases/tag/v1.57.0
* https://github.com/databricks/terraform-provider-databricks/releases/tag/v1.56.0
* https://github.com/databricks/terraform-provider-databricks/releases/tag/v1.55.0

## Tests

Integration tests pass.
  • Loading branch information
pietern authored Nov 14, 2024
1 parent e1978fa commit 21d2788
Show file tree
Hide file tree
Showing 12 changed files with 279 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bundle/internal/tf/codegen/schema/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package schema

const ProviderVersion = "1.54.0"
const ProviderVersion = "1.58.0"
98 changes: 98 additions & 0 deletions bundle/internal/tf/schema/data_source_functions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// Generated from Databricks Terraform provider schema. DO NOT EDIT.

package schema

type DataSourceFunctionsFunctionsInputParamsParameters struct {
Comment string `json:"comment,omitempty"`
Name string `json:"name"`
ParameterDefault string `json:"parameter_default,omitempty"`
ParameterMode string `json:"parameter_mode,omitempty"`
ParameterType string `json:"parameter_type,omitempty"`
Position int `json:"position"`
TypeIntervalType string `json:"type_interval_type,omitempty"`
TypeJson string `json:"type_json,omitempty"`
TypeName string `json:"type_name"`
TypePrecision int `json:"type_precision,omitempty"`
TypeScale int `json:"type_scale,omitempty"`
TypeText string `json:"type_text"`
}

type DataSourceFunctionsFunctionsInputParams struct {
Parameters []DataSourceFunctionsFunctionsInputParamsParameters `json:"parameters,omitempty"`
}

type DataSourceFunctionsFunctionsReturnParamsParameters struct {
Comment string `json:"comment,omitempty"`
Name string `json:"name"`
ParameterDefault string `json:"parameter_default,omitempty"`
ParameterMode string `json:"parameter_mode,omitempty"`
ParameterType string `json:"parameter_type,omitempty"`
Position int `json:"position"`
TypeIntervalType string `json:"type_interval_type,omitempty"`
TypeJson string `json:"type_json,omitempty"`
TypeName string `json:"type_name"`
TypePrecision int `json:"type_precision,omitempty"`
TypeScale int `json:"type_scale,omitempty"`
TypeText string `json:"type_text"`
}

type DataSourceFunctionsFunctionsReturnParams struct {
Parameters []DataSourceFunctionsFunctionsReturnParamsParameters `json:"parameters,omitempty"`
}

type DataSourceFunctionsFunctionsRoutineDependenciesDependenciesFunction struct {
FunctionFullName string `json:"function_full_name"`
}

type DataSourceFunctionsFunctionsRoutineDependenciesDependenciesTable struct {
TableFullName string `json:"table_full_name"`
}

type DataSourceFunctionsFunctionsRoutineDependenciesDependencies struct {
Function []DataSourceFunctionsFunctionsRoutineDependenciesDependenciesFunction `json:"function,omitempty"`
Table []DataSourceFunctionsFunctionsRoutineDependenciesDependenciesTable `json:"table,omitempty"`
}

type DataSourceFunctionsFunctionsRoutineDependencies struct {
Dependencies []DataSourceFunctionsFunctionsRoutineDependenciesDependencies `json:"dependencies,omitempty"`
}

type DataSourceFunctionsFunctions struct {
BrowseOnly bool `json:"browse_only,omitempty"`
CatalogName string `json:"catalog_name,omitempty"`
Comment string `json:"comment,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
DataType string `json:"data_type,omitempty"`
ExternalLanguage string `json:"external_language,omitempty"`
ExternalName string `json:"external_name,omitempty"`
FullDataType string `json:"full_data_type,omitempty"`
FullName string `json:"full_name,omitempty"`
FunctionId string `json:"function_id,omitempty"`
IsDeterministic bool `json:"is_deterministic,omitempty"`
IsNullCall bool `json:"is_null_call,omitempty"`
MetastoreId string `json:"metastore_id,omitempty"`
Name string `json:"name,omitempty"`
Owner string `json:"owner,omitempty"`
ParameterStyle string `json:"parameter_style,omitempty"`
Properties string `json:"properties,omitempty"`
RoutineBody string `json:"routine_body,omitempty"`
RoutineDefinition string `json:"routine_definition,omitempty"`
SchemaName string `json:"schema_name,omitempty"`
SecurityType string `json:"security_type,omitempty"`
SpecificName string `json:"specific_name,omitempty"`
SqlDataAccess string `json:"sql_data_access,omitempty"`
SqlPath string `json:"sql_path,omitempty"`
UpdatedAt int `json:"updated_at,omitempty"`
UpdatedBy string `json:"updated_by,omitempty"`
InputParams []DataSourceFunctionsFunctionsInputParams `json:"input_params,omitempty"`
ReturnParams []DataSourceFunctionsFunctionsReturnParams `json:"return_params,omitempty"`
RoutineDependencies []DataSourceFunctionsFunctionsRoutineDependencies `json:"routine_dependencies,omitempty"`
}

type DataSourceFunctions struct {
CatalogName string `json:"catalog_name"`
IncludeBrowse bool `json:"include_browse,omitempty"`
SchemaName string `json:"schema_name"`
Functions []DataSourceFunctionsFunctions `json:"functions,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type DataSourceStorageCredentialStorageCredentialInfo struct {
Comment string `json:"comment,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
FullName string `json:"full_name,omitempty"`
Id string `json:"id,omitempty"`
IsolationMode string `json:"isolation_mode,omitempty"`
MetastoreId string `json:"metastore_id,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion bundle/internal/tf/schema/data_source_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package schema

type DataSourceVolumes struct {
CatalogName string `json:"catalog_name"`
Id string `json:"id,omitempty"`
Ids []string `json:"ids,omitempty"`
SchemaName string `json:"schema_name"`
}
2 changes: 2 additions & 0 deletions bundle/internal/tf/schema/data_sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type DataSources struct {
Directory map[string]any `json:"databricks_directory,omitempty"`
ExternalLocation map[string]any `json:"databricks_external_location,omitempty"`
ExternalLocations map[string]any `json:"databricks_external_locations,omitempty"`
Functions map[string]any `json:"databricks_functions,omitempty"`
Group map[string]any `json:"databricks_group,omitempty"`
InstancePool map[string]any `json:"databricks_instance_pool,omitempty"`
InstanceProfiles map[string]any `json:"databricks_instance_profiles,omitempty"`
Expand Down Expand Up @@ -79,6 +80,7 @@ func NewDataSources() *DataSources {
Directory: make(map[string]any),
ExternalLocation: make(map[string]any),
ExternalLocations: make(map[string]any),
Functions: make(map[string]any),
Group: make(map[string]any),
InstancePool: make(map[string]any),
InstanceProfiles: make(map[string]any),
Expand Down
46 changes: 46 additions & 0 deletions bundle/internal/tf/schema/resource_alert.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Generated from Databricks Terraform provider schema. DO NOT EDIT.

package schema

type ResourceAlertConditionOperandColumn struct {
Name string `json:"name"`
}

type ResourceAlertConditionOperand struct {
Column *ResourceAlertConditionOperandColumn `json:"column,omitempty"`
}

type ResourceAlertConditionThresholdValue struct {
BoolValue bool `json:"bool_value,omitempty"`
DoubleValue int `json:"double_value,omitempty"`
StringValue string `json:"string_value,omitempty"`
}

type ResourceAlertConditionThreshold struct {
Value *ResourceAlertConditionThresholdValue `json:"value,omitempty"`
}

type ResourceAlertCondition struct {
EmptyResultState string `json:"empty_result_state,omitempty"`
Op string `json:"op"`
Operand *ResourceAlertConditionOperand `json:"operand,omitempty"`
Threshold *ResourceAlertConditionThreshold `json:"threshold,omitempty"`
}

type ResourceAlert struct {
CreateTime string `json:"create_time,omitempty"`
CustomBody string `json:"custom_body,omitempty"`
CustomSubject string `json:"custom_subject,omitempty"`
DisplayName string `json:"display_name"`
Id string `json:"id,omitempty"`
LifecycleState string `json:"lifecycle_state,omitempty"`
NotifyOnOk bool `json:"notify_on_ok,omitempty"`
OwnerUserName string `json:"owner_user_name,omitempty"`
ParentPath string `json:"parent_path,omitempty"`
QueryId string `json:"query_id"`
SecondsToRetrigger int `json:"seconds_to_retrigger,omitempty"`
State string `json:"state,omitempty"`
TriggerTime string `json:"trigger_time,omitempty"`
UpdateTime string `json:"update_time,omitempty"`
Condition *ResourceAlertCondition `json:"condition,omitempty"`
}
23 changes: 23 additions & 0 deletions bundle/internal/tf/schema/resource_custom_app_integration.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Generated from Databricks Terraform provider schema. DO NOT EDIT.

package schema

type ResourceCustomAppIntegrationTokenAccessPolicy struct {
AccessTokenTtlInMinutes int `json:"access_token_ttl_in_minutes,omitempty"`
RefreshTokenTtlInMinutes int `json:"refresh_token_ttl_in_minutes,omitempty"`
}

type ResourceCustomAppIntegration struct {
ClientId string `json:"client_id,omitempty"`
ClientSecret string `json:"client_secret,omitempty"`
Confidential bool `json:"confidential,omitempty"`
CreateTime string `json:"create_time,omitempty"`
CreatedBy int `json:"created_by,omitempty"`
CreatorUsername string `json:"creator_username,omitempty"`
Id string `json:"id,omitempty"`
IntegrationId string `json:"integration_id,omitempty"`
Name string `json:"name,omitempty"`
RedirectUrls []string `json:"redirect_urls,omitempty"`
Scopes []string `json:"scopes,omitempty"`
TokenAccessPolicy *ResourceCustomAppIntegrationTokenAccessPolicy `json:"token_access_policy,omitempty"`
}
18 changes: 9 additions & 9 deletions bundle/internal/tf/schema/resource_library.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ type ResourceLibraryPypi struct {
}

type ResourceLibrary struct {
ClusterId string `json:"cluster_id"`
Egg string `json:"egg,omitempty"`
Id string `json:"id,omitempty"`
Jar string `json:"jar,omitempty"`
Requirements string `json:"requirements,omitempty"`
Whl string `json:"whl,omitempty"`
Cran *ResourceLibraryCran `json:"cran,omitempty"`
Maven *ResourceLibraryMaven `json:"maven,omitempty"`
Pypi *ResourceLibraryPypi `json:"pypi,omitempty"`
ClusterId string `json:"cluster_id"`
Egg string `json:"egg,omitempty"`
Id string `json:"id,omitempty"`
Jar string `json:"jar,omitempty"`
Requirements string `json:"requirements,omitempty"`
Whl string `json:"whl,omitempty"`
Cran []ResourceLibraryCran `json:"cran,omitempty"`
Maven []ResourceLibraryMaven `json:"maven,omitempty"`
Pypi []ResourceLibraryPypi `json:"pypi,omitempty"`
}
8 changes: 8 additions & 0 deletions bundle/internal/tf/schema/resource_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ type ResourcePipelineFilters struct {

type ResourcePipelineGatewayDefinition struct {
ConnectionId string `json:"connection_id,omitempty"`
ConnectionName string `json:"connection_name,omitempty"`
GatewayStorageCatalog string `json:"gateway_storage_catalog,omitempty"`
GatewayStorageName string `json:"gateway_storage_name,omitempty"`
GatewayStorageSchema string `json:"gateway_storage_schema,omitempty"`
Expand Down Expand Up @@ -242,6 +243,12 @@ type ResourcePipelineNotification struct {
EmailRecipients []string `json:"email_recipients,omitempty"`
}

type ResourcePipelineRestartWindow struct {
DaysOfWeek string `json:"days_of_week,omitempty"`
StartHour int `json:"start_hour"`
TimeZoneId string `json:"time_zone_id,omitempty"`
}

type ResourcePipelineTriggerCron struct {
QuartzCronSchedule string `json:"quartz_cron_schedule,omitempty"`
TimezoneId string `json:"timezone_id,omitempty"`
Expand Down Expand Up @@ -288,5 +295,6 @@ type ResourcePipeline struct {
LatestUpdates []ResourcePipelineLatestUpdates `json:"latest_updates,omitempty"`
Library []ResourcePipelineLibrary `json:"library,omitempty"`
Notification []ResourcePipelineNotification `json:"notification,omitempty"`
RestartWindow *ResourcePipelineRestartWindow `json:"restart_window,omitempty"`
Trigger *ResourcePipelineTrigger `json:"trigger,omitempty"`
}
84 changes: 84 additions & 0 deletions bundle/internal/tf/schema/resource_query.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Generated from Databricks Terraform provider schema. DO NOT EDIT.

package schema

type ResourceQueryParameterDateRangeValueDateRangeValue struct {
End string `json:"end"`
Start string `json:"start"`
}

type ResourceQueryParameterDateRangeValue struct {
DynamicDateRangeValue string `json:"dynamic_date_range_value,omitempty"`
Precision string `json:"precision,omitempty"`
StartDayOfWeek int `json:"start_day_of_week,omitempty"`
DateRangeValue *ResourceQueryParameterDateRangeValueDateRangeValue `json:"date_range_value,omitempty"`
}

type ResourceQueryParameterDateValue struct {
DateValue string `json:"date_value,omitempty"`
DynamicDateValue string `json:"dynamic_date_value,omitempty"`
Precision string `json:"precision,omitempty"`
}

type ResourceQueryParameterEnumValueMultiValuesOptions struct {
Prefix string `json:"prefix,omitempty"`
Separator string `json:"separator,omitempty"`
Suffix string `json:"suffix,omitempty"`
}

type ResourceQueryParameterEnumValue struct {
EnumOptions string `json:"enum_options,omitempty"`
Values []string `json:"values,omitempty"`
MultiValuesOptions *ResourceQueryParameterEnumValueMultiValuesOptions `json:"multi_values_options,omitempty"`
}

type ResourceQueryParameterNumericValue struct {
Value int `json:"value"`
}

type ResourceQueryParameterQueryBackedValueMultiValuesOptions struct {
Prefix string `json:"prefix,omitempty"`
Separator string `json:"separator,omitempty"`
Suffix string `json:"suffix,omitempty"`
}

type ResourceQueryParameterQueryBackedValue struct {
QueryId string `json:"query_id"`
Values []string `json:"values,omitempty"`
MultiValuesOptions *ResourceQueryParameterQueryBackedValueMultiValuesOptions `json:"multi_values_options,omitempty"`
}

type ResourceQueryParameterTextValue struct {
Value string `json:"value"`
}

type ResourceQueryParameter struct {
Name string `json:"name"`
Title string `json:"title,omitempty"`
DateRangeValue *ResourceQueryParameterDateRangeValue `json:"date_range_value,omitempty"`
DateValue *ResourceQueryParameterDateValue `json:"date_value,omitempty"`
EnumValue *ResourceQueryParameterEnumValue `json:"enum_value,omitempty"`
NumericValue *ResourceQueryParameterNumericValue `json:"numeric_value,omitempty"`
QueryBackedValue *ResourceQueryParameterQueryBackedValue `json:"query_backed_value,omitempty"`
TextValue *ResourceQueryParameterTextValue `json:"text_value,omitempty"`
}

type ResourceQuery struct {
ApplyAutoLimit bool `json:"apply_auto_limit,omitempty"`
Catalog string `json:"catalog,omitempty"`
CreateTime string `json:"create_time,omitempty"`
Description string `json:"description,omitempty"`
DisplayName string `json:"display_name"`
Id string `json:"id,omitempty"`
LastModifierUserName string `json:"last_modifier_user_name,omitempty"`
LifecycleState string `json:"lifecycle_state,omitempty"`
OwnerUserName string `json:"owner_user_name,omitempty"`
ParentPath string `json:"parent_path,omitempty"`
QueryText string `json:"query_text"`
RunAsMode string `json:"run_as_mode,omitempty"`
Schema string `json:"schema,omitempty"`
Tags []string `json:"tags,omitempty"`
UpdateTime string `json:"update_time,omitempty"`
WarehouseId string `json:"warehouse_id"`
Parameter []ResourceQueryParameter `json:"parameter,omitempty"`
}
Loading

0 comments on commit 21d2788

Please sign in to comment.