From ef0a820cd6bc862486433cd22239e4e5f076af4a Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Fri, 13 Dec 2024 13:38:57 +0100 Subject: [PATCH 1/3] Upgraded to TF provider 1.61.0 --- .../internal/tf/codegen/generator/walker.go | 10 +- bundle/internal/tf/codegen/schema/version.go | 2 +- bundle/internal/tf/schema/data_source_app.go | 8 + bundle/internal/tf/schema/data_source_apps.go | 7 + .../tf/schema/data_source_functions.go | 96 +--------- bundle/internal/tf/schema/data_source_jobs.go | 5 +- .../data_source_notification_destinations.go | 12 +- .../tf/schema/data_source_registered_model.go | 30 +-- .../data_source_registered_model_versions.go | 48 +---- .../schema/data_source_serving_endpoints.go | 173 +----------------- bundle/internal/tf/schema/data_sources.go | 4 + bundle/internal/tf/schema/resource_app.go | 22 +++ .../schema/resource_azure_adls_gen2_mount.go | 1 + .../internal/tf/schema/resource_credential.go | 52 ++++++ bundle/internal/tf/schema/resource_grant.go | 1 + bundle/internal/tf/schema/resource_grants.go | 1 + .../tf/schema/resource_permissions.go | 1 + .../tf/schema/resource_quality_monitor.go | 46 ++--- bundle/internal/tf/schema/resources.go | 4 + bundle/internal/tf/schema/root.go | 8 +- 20 files changed, 153 insertions(+), 378 deletions(-) create mode 100644 bundle/internal/tf/schema/data_source_app.go create mode 100644 bundle/internal/tf/schema/data_source_apps.go create mode 100644 bundle/internal/tf/schema/resource_app.go create mode 100644 bundle/internal/tf/schema/resource_credential.go diff --git a/bundle/internal/tf/codegen/generator/walker.go b/bundle/internal/tf/codegen/generator/walker.go index 2ed044c3d1..c99b757b42 100644 --- a/bundle/internal/tf/codegen/generator/walker.go +++ b/bundle/internal/tf/codegen/generator/walker.go @@ -2,9 +2,8 @@ package generator import ( "fmt" - "strings" - "slices" + "strings" tfjson "github.com/hashicorp/terraform-json" "github.com/iancoleman/strcase" @@ -92,7 +91,12 @@ func (w *walker) walk(block *tfjson.SchemaBlock, name []string) error { // Assert the attribute type is always set. if v.AttributeType == cty.NilType { - return fmt.Errorf("unexpected nil type for attribute %s", k) + // If the attribute is a nested type, the type is an object. + if v.AttributeNestedType != nil { + v.AttributeType = cty.Object(map[string]cty.Type{}) + } else { + return fmt.Errorf("unexpected nil type for attribute %s", k) + } } // Collect field properties. diff --git a/bundle/internal/tf/codegen/schema/version.go b/bundle/internal/tf/codegen/schema/version.go index a778e0232f..a3c5c62819 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.59.0" +const ProviderVersion = "1.61.0" diff --git a/bundle/internal/tf/schema/data_source_app.go b/bundle/internal/tf/schema/data_source_app.go new file mode 100644 index 0000000000..94ae96e715 --- /dev/null +++ b/bundle/internal/tf/schema/data_source_app.go @@ -0,0 +1,8 @@ +// Generated from Databricks Terraform provider schema. DO NOT EDIT. + +package schema + +type DataSourceApp struct { + App any `json:"app,omitempty"` + Name string `json:"name"` +} diff --git a/bundle/internal/tf/schema/data_source_apps.go b/bundle/internal/tf/schema/data_source_apps.go new file mode 100644 index 0000000000..65760d9d9c --- /dev/null +++ b/bundle/internal/tf/schema/data_source_apps.go @@ -0,0 +1,7 @@ +// Generated from Databricks Terraform provider schema. DO NOT EDIT. + +package schema + +type DataSourceApps struct { + App any `json:"app,omitempty"` +} diff --git a/bundle/internal/tf/schema/data_source_functions.go b/bundle/internal/tf/schema/data_source_functions.go index 6085d7522f..f4f8a200b0 100644 --- a/bundle/internal/tf/schema/data_source_functions.go +++ b/bundle/internal/tf/schema/data_source_functions.go @@ -2,97 +2,9 @@ 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"` + CatalogName string `json:"catalog_name"` + Functions any `json:"functions,omitempty"` + IncludeBrowse bool `json:"include_browse,omitempty"` + SchemaName string `json:"schema_name"` } diff --git a/bundle/internal/tf/schema/data_source_jobs.go b/bundle/internal/tf/schema/data_source_jobs.go index 98533c0c81..643f7a9f9f 100644 --- a/bundle/internal/tf/schema/data_source_jobs.go +++ b/bundle/internal/tf/schema/data_source_jobs.go @@ -3,6 +3,7 @@ package schema type DataSourceJobs struct { - Id string `json:"id,omitempty"` - Ids map[string]string `json:"ids,omitempty"` + Id string `json:"id,omitempty"` + Ids map[string]string `json:"ids,omitempty"` + JobNameContains string `json:"job_name_contains,omitempty"` } diff --git a/bundle/internal/tf/schema/data_source_notification_destinations.go b/bundle/internal/tf/schema/data_source_notification_destinations.go index c95ad6db93..78f483bd83 100644 --- a/bundle/internal/tf/schema/data_source_notification_destinations.go +++ b/bundle/internal/tf/schema/data_source_notification_destinations.go @@ -2,14 +2,8 @@ package schema -type DataSourceNotificationDestinationsNotificationDestinations struct { - DestinationType string `json:"destination_type,omitempty"` - DisplayName string `json:"display_name,omitempty"` - Id string `json:"id,omitempty"` -} - type DataSourceNotificationDestinations struct { - DisplayNameContains string `json:"display_name_contains,omitempty"` - Type string `json:"type,omitempty"` - NotificationDestinations []DataSourceNotificationDestinationsNotificationDestinations `json:"notification_destinations,omitempty"` + DisplayNameContains string `json:"display_name_contains,omitempty"` + NotificationDestinations any `json:"notification_destinations,omitempty"` + Type string `json:"type,omitempty"` } diff --git a/bundle/internal/tf/schema/data_source_registered_model.go b/bundle/internal/tf/schema/data_source_registered_model.go index e19e0849ad..6d6d7925b8 100644 --- a/bundle/internal/tf/schema/data_source_registered_model.go +++ b/bundle/internal/tf/schema/data_source_registered_model.go @@ -2,31 +2,9 @@ package schema -type DataSourceRegisteredModelModelInfoAliases struct { - AliasName string `json:"alias_name,omitempty"` - VersionNum int `json:"version_num,omitempty"` -} - -type DataSourceRegisteredModelModelInfo 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"` - FullName string `json:"full_name,omitempty"` - MetastoreId string `json:"metastore_id,omitempty"` - Name string `json:"name,omitempty"` - Owner string `json:"owner,omitempty"` - SchemaName string `json:"schema_name,omitempty"` - StorageLocation string `json:"storage_location,omitempty"` - UpdatedAt int `json:"updated_at,omitempty"` - UpdatedBy string `json:"updated_by,omitempty"` - Aliases []DataSourceRegisteredModelModelInfoAliases `json:"aliases,omitempty"` -} - type DataSourceRegisteredModel struct { - FullName string `json:"full_name"` - IncludeAliases bool `json:"include_aliases,omitempty"` - IncludeBrowse bool `json:"include_browse,omitempty"` - ModelInfo []DataSourceRegisteredModelModelInfo `json:"model_info,omitempty"` + FullName string `json:"full_name"` + IncludeAliases bool `json:"include_aliases,omitempty"` + IncludeBrowse bool `json:"include_browse,omitempty"` + ModelInfo any `json:"model_info,omitempty"` } diff --git a/bundle/internal/tf/schema/data_source_registered_model_versions.go b/bundle/internal/tf/schema/data_source_registered_model_versions.go index f70e58f85f..9537d657c8 100644 --- a/bundle/internal/tf/schema/data_source_registered_model_versions.go +++ b/bundle/internal/tf/schema/data_source_registered_model_versions.go @@ -2,51 +2,7 @@ package schema -type DataSourceRegisteredModelVersionsModelVersionsAliases struct { - AliasName string `json:"alias_name,omitempty"` - VersionNum int `json:"version_num,omitempty"` -} - -type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesFunction struct { - FunctionFullName string `json:"function_full_name"` -} - -type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesTable struct { - TableFullName string `json:"table_full_name"` -} - -type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependencies struct { - Function []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesFunction `json:"function,omitempty"` - Table []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesTable `json:"table,omitempty"` -} - -type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependencies struct { - Dependencies []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependencies `json:"dependencies,omitempty"` -} - -type DataSourceRegisteredModelVersionsModelVersions 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"` - Id string `json:"id,omitempty"` - MetastoreId string `json:"metastore_id,omitempty"` - ModelName string `json:"model_name,omitempty"` - RunId string `json:"run_id,omitempty"` - RunWorkspaceId int `json:"run_workspace_id,omitempty"` - SchemaName string `json:"schema_name,omitempty"` - Source string `json:"source,omitempty"` - Status string `json:"status,omitempty"` - StorageLocation string `json:"storage_location,omitempty"` - UpdatedAt int `json:"updated_at,omitempty"` - UpdatedBy string `json:"updated_by,omitempty"` - Version int `json:"version,omitempty"` - Aliases []DataSourceRegisteredModelVersionsModelVersionsAliases `json:"aliases,omitempty"` - ModelVersionDependencies []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependencies `json:"model_version_dependencies,omitempty"` -} - type DataSourceRegisteredModelVersions struct { - FullName string `json:"full_name"` - ModelVersions []DataSourceRegisteredModelVersionsModelVersions `json:"model_versions,omitempty"` + FullName string `json:"full_name"` + ModelVersions any `json:"model_versions,omitempty"` } diff --git a/bundle/internal/tf/schema/data_source_serving_endpoints.go b/bundle/internal/tf/schema/data_source_serving_endpoints.go index 028121b5ad..2d7dbe9fec 100644 --- a/bundle/internal/tf/schema/data_source_serving_endpoints.go +++ b/bundle/internal/tf/schema/data_source_serving_endpoints.go @@ -2,177 +2,6 @@ package schema -type DataSourceServingEndpointsEndpointsAiGatewayGuardrailsInputPii struct { - Behavior string `json:"behavior"` -} - -type DataSourceServingEndpointsEndpointsAiGatewayGuardrailsInput struct { - InvalidKeywords []string `json:"invalid_keywords,omitempty"` - Safety bool `json:"safety,omitempty"` - ValidTopics []string `json:"valid_topics,omitempty"` - Pii []DataSourceServingEndpointsEndpointsAiGatewayGuardrailsInputPii `json:"pii,omitempty"` -} - -type DataSourceServingEndpointsEndpointsAiGatewayGuardrailsOutputPii struct { - Behavior string `json:"behavior"` -} - -type DataSourceServingEndpointsEndpointsAiGatewayGuardrailsOutput struct { - InvalidKeywords []string `json:"invalid_keywords,omitempty"` - Safety bool `json:"safety,omitempty"` - ValidTopics []string `json:"valid_topics,omitempty"` - Pii []DataSourceServingEndpointsEndpointsAiGatewayGuardrailsOutputPii `json:"pii,omitempty"` -} - -type DataSourceServingEndpointsEndpointsAiGatewayGuardrails struct { - Input []DataSourceServingEndpointsEndpointsAiGatewayGuardrailsInput `json:"input,omitempty"` - Output []DataSourceServingEndpointsEndpointsAiGatewayGuardrailsOutput `json:"output,omitempty"` -} - -type DataSourceServingEndpointsEndpointsAiGatewayInferenceTableConfig struct { - CatalogName string `json:"catalog_name,omitempty"` - Enabled bool `json:"enabled,omitempty"` - SchemaName string `json:"schema_name,omitempty"` - TableNamePrefix string `json:"table_name_prefix,omitempty"` -} - -type DataSourceServingEndpointsEndpointsAiGatewayRateLimits struct { - Calls int `json:"calls"` - Key string `json:"key,omitempty"` - RenewalPeriod string `json:"renewal_period"` -} - -type DataSourceServingEndpointsEndpointsAiGatewayUsageTrackingConfig struct { - Enabled bool `json:"enabled,omitempty"` -} - -type DataSourceServingEndpointsEndpointsAiGateway struct { - Guardrails []DataSourceServingEndpointsEndpointsAiGatewayGuardrails `json:"guardrails,omitempty"` - InferenceTableConfig []DataSourceServingEndpointsEndpointsAiGatewayInferenceTableConfig `json:"inference_table_config,omitempty"` - RateLimits []DataSourceServingEndpointsEndpointsAiGatewayRateLimits `json:"rate_limits,omitempty"` - UsageTrackingConfig []DataSourceServingEndpointsEndpointsAiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` -} - -type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAi21LabsConfig struct { - Ai21LabsApiKey string `json:"ai21labs_api_key,omitempty"` - Ai21LabsApiKeyPlaintext string `json:"ai21labs_api_key_plaintext,omitempty"` -} - -type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAmazonBedrockConfig struct { - AwsAccessKeyId string `json:"aws_access_key_id,omitempty"` - AwsAccessKeyIdPlaintext string `json:"aws_access_key_id_plaintext,omitempty"` - AwsRegion string `json:"aws_region"` - AwsSecretAccessKey string `json:"aws_secret_access_key,omitempty"` - AwsSecretAccessKeyPlaintext string `json:"aws_secret_access_key_plaintext,omitempty"` - BedrockProvider string `json:"bedrock_provider"` -} - -type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAnthropicConfig struct { - AnthropicApiKey string `json:"anthropic_api_key,omitempty"` - AnthropicApiKeyPlaintext string `json:"anthropic_api_key_plaintext,omitempty"` -} - -type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelCohereConfig struct { - CohereApiBase string `json:"cohere_api_base,omitempty"` - CohereApiKey string `json:"cohere_api_key,omitempty"` - CohereApiKeyPlaintext string `json:"cohere_api_key_plaintext,omitempty"` -} - -type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelDatabricksModelServingConfig struct { - DatabricksApiToken string `json:"databricks_api_token,omitempty"` - DatabricksApiTokenPlaintext string `json:"databricks_api_token_plaintext,omitempty"` - DatabricksWorkspaceUrl string `json:"databricks_workspace_url"` -} - -type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelGoogleCloudVertexAiConfig struct { - PrivateKey string `json:"private_key,omitempty"` - PrivateKeyPlaintext string `json:"private_key_plaintext,omitempty"` - ProjectId string `json:"project_id,omitempty"` - Region string `json:"region,omitempty"` -} - -type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelOpenaiConfig struct { - MicrosoftEntraClientId string `json:"microsoft_entra_client_id,omitempty"` - MicrosoftEntraClientSecret string `json:"microsoft_entra_client_secret,omitempty"` - MicrosoftEntraClientSecretPlaintext string `json:"microsoft_entra_client_secret_plaintext,omitempty"` - MicrosoftEntraTenantId string `json:"microsoft_entra_tenant_id,omitempty"` - OpenaiApiBase string `json:"openai_api_base,omitempty"` - OpenaiApiKey string `json:"openai_api_key,omitempty"` - OpenaiApiKeyPlaintext string `json:"openai_api_key_plaintext,omitempty"` - OpenaiApiType string `json:"openai_api_type,omitempty"` - OpenaiApiVersion string `json:"openai_api_version,omitempty"` - OpenaiDeploymentName string `json:"openai_deployment_name,omitempty"` - OpenaiOrganization string `json:"openai_organization,omitempty"` -} - -type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelPalmConfig struct { - PalmApiKey string `json:"palm_api_key,omitempty"` - PalmApiKeyPlaintext string `json:"palm_api_key_plaintext,omitempty"` -} - -type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModel struct { - Name string `json:"name"` - Provider string `json:"provider"` - Task string `json:"task"` - Ai21LabsConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAi21LabsConfig `json:"ai21labs_config,omitempty"` - AmazonBedrockConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAmazonBedrockConfig `json:"amazon_bedrock_config,omitempty"` - AnthropicConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAnthropicConfig `json:"anthropic_config,omitempty"` - CohereConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelCohereConfig `json:"cohere_config,omitempty"` - DatabricksModelServingConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelDatabricksModelServingConfig `json:"databricks_model_serving_config,omitempty"` - GoogleCloudVertexAiConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelGoogleCloudVertexAiConfig `json:"google_cloud_vertex_ai_config,omitempty"` - OpenaiConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelOpenaiConfig `json:"openai_config,omitempty"` - PalmConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelPalmConfig `json:"palm_config,omitempty"` -} - -type DataSourceServingEndpointsEndpointsConfigServedEntitiesFoundationModel struct { - Description string `json:"description,omitempty"` - DisplayName string `json:"display_name,omitempty"` - Docs string `json:"docs,omitempty"` - Name string `json:"name,omitempty"` -} - -type DataSourceServingEndpointsEndpointsConfigServedEntities struct { - EntityName string `json:"entity_name,omitempty"` - EntityVersion string `json:"entity_version,omitempty"` - Name string `json:"name,omitempty"` - ExternalModel []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModel `json:"external_model,omitempty"` - FoundationModel []DataSourceServingEndpointsEndpointsConfigServedEntitiesFoundationModel `json:"foundation_model,omitempty"` -} - -type DataSourceServingEndpointsEndpointsConfigServedModels struct { - ModelName string `json:"model_name,omitempty"` - ModelVersion string `json:"model_version,omitempty"` - Name string `json:"name,omitempty"` -} - -type DataSourceServingEndpointsEndpointsConfig struct { - ServedEntities []DataSourceServingEndpointsEndpointsConfigServedEntities `json:"served_entities,omitempty"` - ServedModels []DataSourceServingEndpointsEndpointsConfigServedModels `json:"served_models,omitempty"` -} - -type DataSourceServingEndpointsEndpointsState struct { - ConfigUpdate string `json:"config_update,omitempty"` - Ready string `json:"ready,omitempty"` -} - -type DataSourceServingEndpointsEndpointsTags struct { - Key string `json:"key"` - Value string `json:"value,omitempty"` -} - -type DataSourceServingEndpointsEndpoints struct { - CreationTimestamp int `json:"creation_timestamp,omitempty"` - Creator string `json:"creator,omitempty"` - Id string `json:"id,omitempty"` - LastUpdatedTimestamp int `json:"last_updated_timestamp,omitempty"` - Name string `json:"name,omitempty"` - Task string `json:"task,omitempty"` - AiGateway []DataSourceServingEndpointsEndpointsAiGateway `json:"ai_gateway,omitempty"` - Config []DataSourceServingEndpointsEndpointsConfig `json:"config,omitempty"` - State []DataSourceServingEndpointsEndpointsState `json:"state,omitempty"` - Tags []DataSourceServingEndpointsEndpointsTags `json:"tags,omitempty"` -} - type DataSourceServingEndpoints struct { - Endpoints []DataSourceServingEndpointsEndpoints `json:"endpoints,omitempty"` + Endpoints any `json:"endpoints,omitempty"` } diff --git a/bundle/internal/tf/schema/data_sources.go b/bundle/internal/tf/schema/data_sources.go index 3a59bf8c37..1880db25a7 100644 --- a/bundle/internal/tf/schema/data_sources.go +++ b/bundle/internal/tf/schema/data_sources.go @@ -3,6 +3,8 @@ package schema type DataSources struct { + App map[string]any `json:"databricks_app,omitempty"` + Apps map[string]any `json:"databricks_apps,omitempty"` AwsAssumeRolePolicy map[string]any `json:"databricks_aws_assume_role_policy,omitempty"` AwsBucketPolicy map[string]any `json:"databricks_aws_bucket_policy,omitempty"` AwsCrossaccountPolicy map[string]any `json:"databricks_aws_crossaccount_policy,omitempty"` @@ -66,6 +68,8 @@ type DataSources struct { func NewDataSources() *DataSources { return &DataSources{ + App: make(map[string]any), + Apps: make(map[string]any), AwsAssumeRolePolicy: make(map[string]any), AwsBucketPolicy: make(map[string]any), AwsCrossaccountPolicy: make(map[string]any), diff --git a/bundle/internal/tf/schema/resource_app.go b/bundle/internal/tf/schema/resource_app.go new file mode 100644 index 0000000000..5ba1d26d82 --- /dev/null +++ b/bundle/internal/tf/schema/resource_app.go @@ -0,0 +1,22 @@ +// Generated from Databricks Terraform provider schema. DO NOT EDIT. + +package schema + +type ResourceApp struct { + ActiveDeployment any `json:"active_deployment,omitempty"` + AppStatus any `json:"app_status,omitempty"` + ComputeStatus any `json:"compute_status,omitempty"` + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` + DefaultSourceCodePath string `json:"default_source_code_path,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name"` + PendingDeployment any `json:"pending_deployment,omitempty"` + Resources any `json:"resources,omitempty"` + ServicePrincipalClientId string `json:"service_principal_client_id,omitempty"` + ServicePrincipalId int `json:"service_principal_id,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UpdateTime string `json:"update_time,omitempty"` + Updater string `json:"updater,omitempty"` + Url string `json:"url,omitempty"` +} diff --git a/bundle/internal/tf/schema/resource_azure_adls_gen2_mount.go b/bundle/internal/tf/schema/resource_azure_adls_gen2_mount.go index d0f96d54ea..6e2ea08e82 100644 --- a/bundle/internal/tf/schema/resource_azure_adls_gen2_mount.go +++ b/bundle/internal/tf/schema/resource_azure_adls_gen2_mount.go @@ -9,6 +9,7 @@ type ResourceAzureAdlsGen2Mount struct { ClusterId string `json:"cluster_id,omitempty"` ContainerName string `json:"container_name"` Directory string `json:"directory,omitempty"` + Environment string `json:"environment,omitempty"` Id string `json:"id,omitempty"` InitializeFileSystem bool `json:"initialize_file_system"` MountName string `json:"mount_name"` diff --git a/bundle/internal/tf/schema/resource_credential.go b/bundle/internal/tf/schema/resource_credential.go new file mode 100644 index 0000000000..9d47219ea9 --- /dev/null +++ b/bundle/internal/tf/schema/resource_credential.go @@ -0,0 +1,52 @@ +// Generated from Databricks Terraform provider schema. DO NOT EDIT. + +package schema + +type ResourceCredentialAwsIamRole struct { + ExternalId string `json:"external_id,omitempty"` + RoleArn string `json:"role_arn,omitempty"` + UnityCatalogIamArn string `json:"unity_catalog_iam_arn,omitempty"` +} + +type ResourceCredentialAzureManagedIdentity struct { + AccessConnectorId string `json:"access_connector_id"` + CredentialId string `json:"credential_id,omitempty"` + ManagedIdentityId string `json:"managed_identity_id,omitempty"` +} + +type ResourceCredentialAzureServicePrincipal struct { + ApplicationId string `json:"application_id"` + ClientSecret string `json:"client_secret"` + DirectoryId string `json:"directory_id"` +} + +type ResourceCredentialDatabricksGcpServiceAccount struct { + CredentialId string `json:"credential_id,omitempty"` + Email string `json:"email,omitempty"` + PrivateKeyId string `json:"private_key_id,omitempty"` +} + +type ResourceCredential struct { + Comment string `json:"comment,omitempty"` + CreatedAt int `json:"created_at,omitempty"` + CreatedBy string `json:"created_by,omitempty"` + CredentialId string `json:"credential_id,omitempty"` + ForceDestroy bool `json:"force_destroy,omitempty"` + ForceUpdate bool `json:"force_update,omitempty"` + FullName string `json:"full_name,omitempty"` + Id string `json:"id,omitempty"` + IsolationMode string `json:"isolation_mode,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name"` + Owner string `json:"owner,omitempty"` + Purpose string `json:"purpose"` + ReadOnly bool `json:"read_only,omitempty"` + SkipValidation bool `json:"skip_validation,omitempty"` + UpdatedAt int `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` + UsedForManagedStorage bool `json:"used_for_managed_storage,omitempty"` + AwsIamRole *ResourceCredentialAwsIamRole `json:"aws_iam_role,omitempty"` + AzureManagedIdentity *ResourceCredentialAzureManagedIdentity `json:"azure_managed_identity,omitempty"` + AzureServicePrincipal *ResourceCredentialAzureServicePrincipal `json:"azure_service_principal,omitempty"` + DatabricksGcpServiceAccount *ResourceCredentialDatabricksGcpServiceAccount `json:"databricks_gcp_service_account,omitempty"` +} diff --git a/bundle/internal/tf/schema/resource_grant.go b/bundle/internal/tf/schema/resource_grant.go index d8569f3042..6ed97791cc 100644 --- a/bundle/internal/tf/schema/resource_grant.go +++ b/bundle/internal/tf/schema/resource_grant.go @@ -4,6 +4,7 @@ package schema type ResourceGrant struct { Catalog string `json:"catalog,omitempty"` + Credential string `json:"credential,omitempty"` ExternalLocation string `json:"external_location,omitempty"` ForeignConnection string `json:"foreign_connection,omitempty"` Function string `json:"function,omitempty"` diff --git a/bundle/internal/tf/schema/resource_grants.go b/bundle/internal/tf/schema/resource_grants.go index dd00152fba..474a9950fc 100644 --- a/bundle/internal/tf/schema/resource_grants.go +++ b/bundle/internal/tf/schema/resource_grants.go @@ -9,6 +9,7 @@ type ResourceGrantsGrant struct { type ResourceGrants struct { Catalog string `json:"catalog,omitempty"` + Credential string `json:"credential,omitempty"` ExternalLocation string `json:"external_location,omitempty"` ForeignConnection string `json:"foreign_connection,omitempty"` Function string `json:"function,omitempty"` diff --git a/bundle/internal/tf/schema/resource_permissions.go b/bundle/internal/tf/schema/resource_permissions.go index a3d05e6f2c..7dfb84b5ff 100644 --- a/bundle/internal/tf/schema/resource_permissions.go +++ b/bundle/internal/tf/schema/resource_permissions.go @@ -10,6 +10,7 @@ type ResourcePermissionsAccessControl struct { } type ResourcePermissions struct { + AppName string `json:"app_name,omitempty"` Authorization string `json:"authorization,omitempty"` ClusterId string `json:"cluster_id,omitempty"` ClusterPolicyId string `json:"cluster_policy_id,omitempty"` diff --git a/bundle/internal/tf/schema/resource_quality_monitor.go b/bundle/internal/tf/schema/resource_quality_monitor.go index 0fc2abd666..61d18e9303 100644 --- a/bundle/internal/tf/schema/resource_quality_monitor.go +++ b/bundle/internal/tf/schema/resource_quality_monitor.go @@ -33,8 +33,8 @@ type ResourceQualityMonitorNotificationsOnNewClassificationTagDetected struct { } type ResourceQualityMonitorNotifications struct { - OnFailure *ResourceQualityMonitorNotificationsOnFailure `json:"on_failure,omitempty"` - OnNewClassificationTagDetected *ResourceQualityMonitorNotificationsOnNewClassificationTagDetected `json:"on_new_classification_tag_detected,omitempty"` + OnFailure []ResourceQualityMonitorNotificationsOnFailure `json:"on_failure,omitempty"` + OnNewClassificationTagDetected []ResourceQualityMonitorNotificationsOnNewClassificationTagDetected `json:"on_new_classification_tag_detected,omitempty"` } type ResourceQualityMonitorSchedule struct { @@ -52,25 +52,25 @@ type ResourceQualityMonitorTimeSeries struct { } type ResourceQualityMonitor struct { - AssetsDir string `json:"assets_dir"` - BaselineTableName string `json:"baseline_table_name,omitempty"` - DashboardId string `json:"dashboard_id,omitempty"` - DriftMetricsTableName string `json:"drift_metrics_table_name,omitempty"` - Id string `json:"id,omitempty"` - LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` - MonitorVersion string `json:"monitor_version,omitempty"` - OutputSchemaName string `json:"output_schema_name"` - ProfileMetricsTableName string `json:"profile_metrics_table_name,omitempty"` - SkipBuiltinDashboard bool `json:"skip_builtin_dashboard,omitempty"` - SlicingExprs []string `json:"slicing_exprs,omitempty"` - Status string `json:"status,omitempty"` - TableName string `json:"table_name"` - WarehouseId string `json:"warehouse_id,omitempty"` - CustomMetrics []ResourceQualityMonitorCustomMetrics `json:"custom_metrics,omitempty"` - DataClassificationConfig *ResourceQualityMonitorDataClassificationConfig `json:"data_classification_config,omitempty"` - InferenceLog *ResourceQualityMonitorInferenceLog `json:"inference_log,omitempty"` - Notifications *ResourceQualityMonitorNotifications `json:"notifications,omitempty"` - Schedule *ResourceQualityMonitorSchedule `json:"schedule,omitempty"` - Snapshot *ResourceQualityMonitorSnapshot `json:"snapshot,omitempty"` - TimeSeries *ResourceQualityMonitorTimeSeries `json:"time_series,omitempty"` + AssetsDir string `json:"assets_dir"` + BaselineTableName string `json:"baseline_table_name,omitempty"` + DashboardId string `json:"dashboard_id,omitempty"` + DriftMetricsTableName string `json:"drift_metrics_table_name,omitempty"` + Id string `json:"id,omitempty"` + LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` + MonitorVersion string `json:"monitor_version,omitempty"` + OutputSchemaName string `json:"output_schema_name"` + ProfileMetricsTableName string `json:"profile_metrics_table_name,omitempty"` + SkipBuiltinDashboard bool `json:"skip_builtin_dashboard,omitempty"` + SlicingExprs []string `json:"slicing_exprs,omitempty"` + Status string `json:"status,omitempty"` + TableName string `json:"table_name"` + WarehouseId string `json:"warehouse_id,omitempty"` + CustomMetrics []ResourceQualityMonitorCustomMetrics `json:"custom_metrics,omitempty"` + DataClassificationConfig []ResourceQualityMonitorDataClassificationConfig `json:"data_classification_config,omitempty"` + InferenceLog []ResourceQualityMonitorInferenceLog `json:"inference_log,omitempty"` + Notifications []ResourceQualityMonitorNotifications `json:"notifications,omitempty"` + Schedule []ResourceQualityMonitorSchedule `json:"schedule,omitempty"` + Snapshot []ResourceQualityMonitorSnapshot `json:"snapshot,omitempty"` + TimeSeries []ResourceQualityMonitorTimeSeries `json:"time_series,omitempty"` } diff --git a/bundle/internal/tf/schema/resources.go b/bundle/internal/tf/schema/resources.go index ea5b618fd7..b57c2711a0 100644 --- a/bundle/internal/tf/schema/resources.go +++ b/bundle/internal/tf/schema/resources.go @@ -5,6 +5,7 @@ package schema type Resources struct { AccessControlRuleSet map[string]any `json:"databricks_access_control_rule_set,omitempty"` Alert map[string]any `json:"databricks_alert,omitempty"` + App map[string]any `json:"databricks_app,omitempty"` ArtifactAllowlist map[string]any `json:"databricks_artifact_allowlist,omitempty"` AutomaticClusterUpdateWorkspaceSetting map[string]any `json:"databricks_automatic_cluster_update_workspace_setting,omitempty"` AwsS3Mount map[string]any `json:"databricks_aws_s3_mount,omitempty"` @@ -18,6 +19,7 @@ type Resources struct { ClusterPolicy map[string]any `json:"databricks_cluster_policy,omitempty"` ComplianceSecurityProfileWorkspaceSetting map[string]any `json:"databricks_compliance_security_profile_workspace_setting,omitempty"` Connection map[string]any `json:"databricks_connection,omitempty"` + Credential map[string]any `json:"databricks_credential,omitempty"` CustomAppIntegration map[string]any `json:"databricks_custom_app_integration,omitempty"` Dashboard map[string]any `json:"databricks_dashboard,omitempty"` DbfsFile map[string]any `json:"databricks_dbfs_file,omitempty"` @@ -111,6 +113,7 @@ func NewResources() *Resources { return &Resources{ AccessControlRuleSet: make(map[string]any), Alert: make(map[string]any), + App: make(map[string]any), ArtifactAllowlist: make(map[string]any), AutomaticClusterUpdateWorkspaceSetting: make(map[string]any), AwsS3Mount: make(map[string]any), @@ -124,6 +127,7 @@ func NewResources() *Resources { ClusterPolicy: make(map[string]any), ComplianceSecurityProfileWorkspaceSetting: make(map[string]any), Connection: make(map[string]any), + Credential: make(map[string]any), CustomAppIntegration: make(map[string]any), Dashboard: make(map[string]any), DbfsFile: make(map[string]any), diff --git a/bundle/internal/tf/schema/root.go b/bundle/internal/tf/schema/root.go index 2cadb80905..8682b70527 100644 --- a/bundle/internal/tf/schema/root.go +++ b/bundle/internal/tf/schema/root.go @@ -21,13 +21,13 @@ type Root struct { const ProviderHost = "registry.terraform.io" const ProviderSource = "databricks/databricks" -const ProviderVersion = "1.59.0" +const ProviderVersion = "1.61.0" func NewRoot() *Root { return &Root{ - Terraform: map[string]any{ - "required_providers": map[string]any{ - "databricks": map[string]any{ + Terraform: map[string]interface{}{ + "required_providers": map[string]interface{}{ + "databricks": map[string]interface{}{ "source": ProviderSource, "version": ProviderVersion, }, From d741259be6093a1394162cf29229618eba7b0632 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Fri, 13 Dec 2024 14:48:54 +0100 Subject: [PATCH 2/3] process attribute nested type correctly --- .../internal/tf/codegen/generator/walker.go | 59 +++--- bundle/internal/tf/schema/data_source_app.go | 103 ++++++++++- bundle/internal/tf/schema/data_source_apps.go | 101 +++++++++- .../tf/schema/data_source_functions.go | 96 +++++++++- .../data_source_notification_destinations.go | 12 +- .../tf/schema/data_source_registered_model.go | 30 ++- .../data_source_registered_model_versions.go | 48 ++++- .../schema/data_source_serving_endpoints.go | 173 +++++++++++++++++- bundle/internal/tf/schema/resource_app.go | 112 ++++++++++-- .../tf/schema/resource_quality_monitor.go | 46 ++--- 10 files changed, 701 insertions(+), 79 deletions(-) diff --git a/bundle/internal/tf/codegen/generator/walker.go b/bundle/internal/tf/codegen/generator/walker.go index c99b757b42..67525a6e37 100644 --- a/bundle/internal/tf/codegen/generator/walker.go +++ b/bundle/internal/tf/codegen/generator/walker.go @@ -69,6 +69,26 @@ func nestedBlockKeys(block *tfjson.SchemaBlock) []string { return keys } +func nestedField(name []string, k string, isRef bool) field { + // Collect field properties. + fieldName := strcase.ToCamel(k) + fieldTypePrefix := "" + if isRef { + fieldTypePrefix = "*" + } else { + fieldTypePrefix = "[]" + } + fieldType := fmt.Sprintf("%s%s", fieldTypePrefix, strings.Join(append(name, strcase.ToCamel(k)), "")) + fieldTag := fmt.Sprintf("%s,omitempty", k) + + // Append to list of fields for type. + return field{ + Name: fieldName, + Type: fieldType, + Tag: fieldTag, + } +} + func (w *walker) walk(block *tfjson.SchemaBlock, name []string) error { // Produce nested types before this block itself. // This ensures types are defined before they are referenced. @@ -90,13 +110,22 @@ func (w *walker) walk(block *tfjson.SchemaBlock, name []string) error { v := block.Attributes[k] // Assert the attribute type is always set. - if v.AttributeType == cty.NilType { - // If the attribute is a nested type, the type is an object. - if v.AttributeNestedType != nil { - v.AttributeType = cty.Object(map[string]cty.Type{}) - } else { - return fmt.Errorf("unexpected nil type for attribute %s", k) + if v.AttributeType == cty.NilType && v.AttributeNestedType == nil { + return fmt.Errorf("unexpected nil type for attribute %s", k) + } + + // If there is a nested type, walk it and continue to next attribute. + if v.AttributeNestedType != nil { + nestedBlock := &tfjson.SchemaBlock{ + Attributes: v.AttributeNestedType.Attributes, + } + err := w.walk(nestedBlock, append(name, strcase.ToCamel(k))) + if err != nil { + return err } + // Append to list of fields for type. + typ.Fields = append(typ.Fields, nestedField(name, k, v.AttributeNestedType.NestingMode == tfjson.SchemaNestingModeSingle)) + continue } // Collect field properties. @@ -121,24 +150,8 @@ func (w *walker) walk(block *tfjson.SchemaBlock, name []string) error { // Declare nested blocks. for _, k := range nestedBlockKeys(block) { v := block.NestedBlocks[k] - - // Collect field properties. - fieldName := strcase.ToCamel(k) - fieldTypePrefix := "" - if v.MaxItems == 1 { - fieldTypePrefix = "*" - } else { - fieldTypePrefix = "[]" - } - fieldType := fmt.Sprintf("%s%s", fieldTypePrefix, strings.Join(append(name, strcase.ToCamel(k)), "")) - fieldTag := fmt.Sprintf("%s,omitempty", k) - // Append to list of fields for type. - typ.Fields = append(typ.Fields, field{ - Name: fieldName, - Type: fieldType, - Tag: fieldTag, - }) + typ.Fields = append(typ.Fields, nestedField(name, k, v.MaxItems == 1)) } // Append type to list of structs. diff --git a/bundle/internal/tf/schema/data_source_app.go b/bundle/internal/tf/schema/data_source_app.go index 94ae96e715..9b4ef077e7 100644 --- a/bundle/internal/tf/schema/data_source_app.go +++ b/bundle/internal/tf/schema/data_source_app.go @@ -2,7 +2,106 @@ package schema +type DataSourceAppAppActiveDeploymentDeploymentArtifacts struct { + SourceCodePath string `json:"source_code_path,omitempty"` +} + +type DataSourceAppAppActiveDeploymentStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type DataSourceAppAppActiveDeployment struct { + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` + DeploymentArtifacts *DataSourceAppAppActiveDeploymentDeploymentArtifacts `json:"deployment_artifacts,omitempty"` + DeploymentId string `json:"deployment_id,omitempty"` + Mode string `json:"mode,omitempty"` + SourceCodePath string `json:"source_code_path,omitempty"` + Status *DataSourceAppAppActiveDeploymentStatus `json:"status,omitempty"` + UpdateTime string `json:"update_time,omitempty"` +} + +type DataSourceAppAppAppStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type DataSourceAppAppComputeStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type DataSourceAppAppPendingDeploymentDeploymentArtifacts struct { + SourceCodePath string `json:"source_code_path,omitempty"` +} + +type DataSourceAppAppPendingDeploymentStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type DataSourceAppAppPendingDeployment struct { + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` + DeploymentArtifacts *DataSourceAppAppPendingDeploymentDeploymentArtifacts `json:"deployment_artifacts,omitempty"` + DeploymentId string `json:"deployment_id,omitempty"` + Mode string `json:"mode,omitempty"` + SourceCodePath string `json:"source_code_path,omitempty"` + Status *DataSourceAppAppPendingDeploymentStatus `json:"status,omitempty"` + UpdateTime string `json:"update_time,omitempty"` +} + +type DataSourceAppAppResourcesJob struct { + Id string `json:"id"` + Permission string `json:"permission"` +} + +type DataSourceAppAppResourcesSecret struct { + Key string `json:"key"` + Permission string `json:"permission"` + Scope string `json:"scope"` +} + +type DataSourceAppAppResourcesServingEndpoint struct { + Name string `json:"name"` + Permission string `json:"permission"` +} + +type DataSourceAppAppResourcesSqlWarehouse struct { + Id string `json:"id"` + Permission string `json:"permission"` +} + +type DataSourceAppAppResources struct { + Description string `json:"description,omitempty"` + Job *DataSourceAppAppResourcesJob `json:"job,omitempty"` + Name string `json:"name"` + Secret *DataSourceAppAppResourcesSecret `json:"secret,omitempty"` + ServingEndpoint *DataSourceAppAppResourcesServingEndpoint `json:"serving_endpoint,omitempty"` + SqlWarehouse *DataSourceAppAppResourcesSqlWarehouse `json:"sql_warehouse,omitempty"` +} + +type DataSourceAppApp struct { + ActiveDeployment *DataSourceAppAppActiveDeployment `json:"active_deployment,omitempty"` + AppStatus *DataSourceAppAppAppStatus `json:"app_status,omitempty"` + ComputeStatus *DataSourceAppAppComputeStatus `json:"compute_status,omitempty"` + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` + DefaultSourceCodePath string `json:"default_source_code_path,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name"` + PendingDeployment *DataSourceAppAppPendingDeployment `json:"pending_deployment,omitempty"` + Resources []DataSourceAppAppResources `json:"resources,omitempty"` + ServicePrincipalClientId string `json:"service_principal_client_id,omitempty"` + ServicePrincipalId int `json:"service_principal_id,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UpdateTime string `json:"update_time,omitempty"` + Updater string `json:"updater,omitempty"` + Url string `json:"url,omitempty"` +} + type DataSourceApp struct { - App any `json:"app,omitempty"` - Name string `json:"name"` + App *DataSourceAppApp `json:"app,omitempty"` + Name string `json:"name"` } diff --git a/bundle/internal/tf/schema/data_source_apps.go b/bundle/internal/tf/schema/data_source_apps.go index 65760d9d9c..dd381eabff 100644 --- a/bundle/internal/tf/schema/data_source_apps.go +++ b/bundle/internal/tf/schema/data_source_apps.go @@ -2,6 +2,105 @@ package schema +type DataSourceAppsAppActiveDeploymentDeploymentArtifacts struct { + SourceCodePath string `json:"source_code_path,omitempty"` +} + +type DataSourceAppsAppActiveDeploymentStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type DataSourceAppsAppActiveDeployment struct { + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` + DeploymentArtifacts *DataSourceAppsAppActiveDeploymentDeploymentArtifacts `json:"deployment_artifacts,omitempty"` + DeploymentId string `json:"deployment_id,omitempty"` + Mode string `json:"mode,omitempty"` + SourceCodePath string `json:"source_code_path,omitempty"` + Status *DataSourceAppsAppActiveDeploymentStatus `json:"status,omitempty"` + UpdateTime string `json:"update_time,omitempty"` +} + +type DataSourceAppsAppAppStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type DataSourceAppsAppComputeStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type DataSourceAppsAppPendingDeploymentDeploymentArtifacts struct { + SourceCodePath string `json:"source_code_path,omitempty"` +} + +type DataSourceAppsAppPendingDeploymentStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type DataSourceAppsAppPendingDeployment struct { + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` + DeploymentArtifacts *DataSourceAppsAppPendingDeploymentDeploymentArtifacts `json:"deployment_artifacts,omitempty"` + DeploymentId string `json:"deployment_id,omitempty"` + Mode string `json:"mode,omitempty"` + SourceCodePath string `json:"source_code_path,omitempty"` + Status *DataSourceAppsAppPendingDeploymentStatus `json:"status,omitempty"` + UpdateTime string `json:"update_time,omitempty"` +} + +type DataSourceAppsAppResourcesJob struct { + Id string `json:"id"` + Permission string `json:"permission"` +} + +type DataSourceAppsAppResourcesSecret struct { + Key string `json:"key"` + Permission string `json:"permission"` + Scope string `json:"scope"` +} + +type DataSourceAppsAppResourcesServingEndpoint struct { + Name string `json:"name"` + Permission string `json:"permission"` +} + +type DataSourceAppsAppResourcesSqlWarehouse struct { + Id string `json:"id"` + Permission string `json:"permission"` +} + +type DataSourceAppsAppResources struct { + Description string `json:"description,omitempty"` + Job *DataSourceAppsAppResourcesJob `json:"job,omitempty"` + Name string `json:"name"` + Secret *DataSourceAppsAppResourcesSecret `json:"secret,omitempty"` + ServingEndpoint *DataSourceAppsAppResourcesServingEndpoint `json:"serving_endpoint,omitempty"` + SqlWarehouse *DataSourceAppsAppResourcesSqlWarehouse `json:"sql_warehouse,omitempty"` +} + +type DataSourceAppsApp struct { + ActiveDeployment *DataSourceAppsAppActiveDeployment `json:"active_deployment,omitempty"` + AppStatus *DataSourceAppsAppAppStatus `json:"app_status,omitempty"` + ComputeStatus *DataSourceAppsAppComputeStatus `json:"compute_status,omitempty"` + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` + DefaultSourceCodePath string `json:"default_source_code_path,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name"` + PendingDeployment *DataSourceAppsAppPendingDeployment `json:"pending_deployment,omitempty"` + Resources []DataSourceAppsAppResources `json:"resources,omitempty"` + ServicePrincipalClientId string `json:"service_principal_client_id,omitempty"` + ServicePrincipalId int `json:"service_principal_id,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UpdateTime string `json:"update_time,omitempty"` + Updater string `json:"updater,omitempty"` + Url string `json:"url,omitempty"` +} + type DataSourceApps struct { - App any `json:"app,omitempty"` + App []DataSourceAppsApp `json:"app,omitempty"` } diff --git a/bundle/internal/tf/schema/data_source_functions.go b/bundle/internal/tf/schema/data_source_functions.go index f4f8a200b0..416db8fc83 100644 --- a/bundle/internal/tf/schema/data_source_functions.go +++ b/bundle/internal/tf/schema/data_source_functions.go @@ -2,9 +2,97 @@ 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"` + InputParams []DataSourceFunctionsFunctionsInputParams `json:"input_params,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"` + ReturnParams []DataSourceFunctionsFunctionsReturnParams `json:"return_params,omitempty"` + RoutineBody string `json:"routine_body,omitempty"` + RoutineDefinition string `json:"routine_definition,omitempty"` + RoutineDependencies []DataSourceFunctionsFunctionsRoutineDependencies `json:"routine_dependencies,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"` +} + type DataSourceFunctions struct { - CatalogName string `json:"catalog_name"` - Functions any `json:"functions,omitempty"` - IncludeBrowse bool `json:"include_browse,omitempty"` - SchemaName string `json:"schema_name"` + CatalogName string `json:"catalog_name"` + Functions []DataSourceFunctionsFunctions `json:"functions,omitempty"` + IncludeBrowse bool `json:"include_browse,omitempty"` + SchemaName string `json:"schema_name"` } diff --git a/bundle/internal/tf/schema/data_source_notification_destinations.go b/bundle/internal/tf/schema/data_source_notification_destinations.go index 78f483bd83..8447b497bc 100644 --- a/bundle/internal/tf/schema/data_source_notification_destinations.go +++ b/bundle/internal/tf/schema/data_source_notification_destinations.go @@ -2,8 +2,14 @@ package schema +type DataSourceNotificationDestinationsNotificationDestinations struct { + DestinationType string `json:"destination_type,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Id string `json:"id,omitempty"` +} + type DataSourceNotificationDestinations struct { - DisplayNameContains string `json:"display_name_contains,omitempty"` - NotificationDestinations any `json:"notification_destinations,omitempty"` - Type string `json:"type,omitempty"` + DisplayNameContains string `json:"display_name_contains,omitempty"` + NotificationDestinations []DataSourceNotificationDestinationsNotificationDestinations `json:"notification_destinations,omitempty"` + Type string `json:"type,omitempty"` } diff --git a/bundle/internal/tf/schema/data_source_registered_model.go b/bundle/internal/tf/schema/data_source_registered_model.go index 6d6d7925b8..41d69ff8f3 100644 --- a/bundle/internal/tf/schema/data_source_registered_model.go +++ b/bundle/internal/tf/schema/data_source_registered_model.go @@ -2,9 +2,31 @@ package schema +type DataSourceRegisteredModelModelInfoAliases struct { + AliasName string `json:"alias_name,omitempty"` + VersionNum int `json:"version_num,omitempty"` +} + +type DataSourceRegisteredModelModelInfo struct { + Aliases []DataSourceRegisteredModelModelInfoAliases `json:"aliases,omitempty"` + 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"` + FullName string `json:"full_name,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + Name string `json:"name,omitempty"` + Owner string `json:"owner,omitempty"` + SchemaName string `json:"schema_name,omitempty"` + StorageLocation string `json:"storage_location,omitempty"` + UpdatedAt int `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` +} + type DataSourceRegisteredModel struct { - FullName string `json:"full_name"` - IncludeAliases bool `json:"include_aliases,omitempty"` - IncludeBrowse bool `json:"include_browse,omitempty"` - ModelInfo any `json:"model_info,omitempty"` + FullName string `json:"full_name"` + IncludeAliases bool `json:"include_aliases,omitempty"` + IncludeBrowse bool `json:"include_browse,omitempty"` + ModelInfo []DataSourceRegisteredModelModelInfo `json:"model_info,omitempty"` } diff --git a/bundle/internal/tf/schema/data_source_registered_model_versions.go b/bundle/internal/tf/schema/data_source_registered_model_versions.go index 9537d657c8..1a670dfbc9 100644 --- a/bundle/internal/tf/schema/data_source_registered_model_versions.go +++ b/bundle/internal/tf/schema/data_source_registered_model_versions.go @@ -2,7 +2,51 @@ package schema +type DataSourceRegisteredModelVersionsModelVersionsAliases struct { + AliasName string `json:"alias_name,omitempty"` + VersionNum int `json:"version_num,omitempty"` +} + +type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesFunction struct { + FunctionFullName string `json:"function_full_name"` +} + +type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesTable struct { + TableFullName string `json:"table_full_name"` +} + +type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependencies struct { + Function []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesFunction `json:"function,omitempty"` + Table []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependenciesTable `json:"table,omitempty"` +} + +type DataSourceRegisteredModelVersionsModelVersionsModelVersionDependencies struct { + Dependencies []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependenciesDependencies `json:"dependencies,omitempty"` +} + +type DataSourceRegisteredModelVersionsModelVersions struct { + Aliases []DataSourceRegisteredModelVersionsModelVersionsAliases `json:"aliases,omitempty"` + 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"` + Id string `json:"id,omitempty"` + MetastoreId string `json:"metastore_id,omitempty"` + ModelName string `json:"model_name,omitempty"` + ModelVersionDependencies []DataSourceRegisteredModelVersionsModelVersionsModelVersionDependencies `json:"model_version_dependencies,omitempty"` + RunId string `json:"run_id,omitempty"` + RunWorkspaceId int `json:"run_workspace_id,omitempty"` + SchemaName string `json:"schema_name,omitempty"` + Source string `json:"source,omitempty"` + Status string `json:"status,omitempty"` + StorageLocation string `json:"storage_location,omitempty"` + UpdatedAt int `json:"updated_at,omitempty"` + UpdatedBy string `json:"updated_by,omitempty"` + Version int `json:"version,omitempty"` +} + type DataSourceRegisteredModelVersions struct { - FullName string `json:"full_name"` - ModelVersions any `json:"model_versions,omitempty"` + FullName string `json:"full_name"` + ModelVersions []DataSourceRegisteredModelVersionsModelVersions `json:"model_versions,omitempty"` } diff --git a/bundle/internal/tf/schema/data_source_serving_endpoints.go b/bundle/internal/tf/schema/data_source_serving_endpoints.go index 2d7dbe9fec..bdfd778e03 100644 --- a/bundle/internal/tf/schema/data_source_serving_endpoints.go +++ b/bundle/internal/tf/schema/data_source_serving_endpoints.go @@ -2,6 +2,177 @@ package schema +type DataSourceServingEndpointsEndpointsAiGatewayGuardrailsInputPii struct { + Behavior string `json:"behavior"` +} + +type DataSourceServingEndpointsEndpointsAiGatewayGuardrailsInput struct { + InvalidKeywords []string `json:"invalid_keywords,omitempty"` + Pii []DataSourceServingEndpointsEndpointsAiGatewayGuardrailsInputPii `json:"pii,omitempty"` + Safety bool `json:"safety,omitempty"` + ValidTopics []string `json:"valid_topics,omitempty"` +} + +type DataSourceServingEndpointsEndpointsAiGatewayGuardrailsOutputPii struct { + Behavior string `json:"behavior"` +} + +type DataSourceServingEndpointsEndpointsAiGatewayGuardrailsOutput struct { + InvalidKeywords []string `json:"invalid_keywords,omitempty"` + Pii []DataSourceServingEndpointsEndpointsAiGatewayGuardrailsOutputPii `json:"pii,omitempty"` + Safety bool `json:"safety,omitempty"` + ValidTopics []string `json:"valid_topics,omitempty"` +} + +type DataSourceServingEndpointsEndpointsAiGatewayGuardrails struct { + Input []DataSourceServingEndpointsEndpointsAiGatewayGuardrailsInput `json:"input,omitempty"` + Output []DataSourceServingEndpointsEndpointsAiGatewayGuardrailsOutput `json:"output,omitempty"` +} + +type DataSourceServingEndpointsEndpointsAiGatewayInferenceTableConfig struct { + CatalogName string `json:"catalog_name,omitempty"` + Enabled bool `json:"enabled,omitempty"` + SchemaName string `json:"schema_name,omitempty"` + TableNamePrefix string `json:"table_name_prefix,omitempty"` +} + +type DataSourceServingEndpointsEndpointsAiGatewayRateLimits struct { + Calls int `json:"calls"` + Key string `json:"key,omitempty"` + RenewalPeriod string `json:"renewal_period"` +} + +type DataSourceServingEndpointsEndpointsAiGatewayUsageTrackingConfig struct { + Enabled bool `json:"enabled,omitempty"` +} + +type DataSourceServingEndpointsEndpointsAiGateway struct { + Guardrails []DataSourceServingEndpointsEndpointsAiGatewayGuardrails `json:"guardrails,omitempty"` + InferenceTableConfig []DataSourceServingEndpointsEndpointsAiGatewayInferenceTableConfig `json:"inference_table_config,omitempty"` + RateLimits []DataSourceServingEndpointsEndpointsAiGatewayRateLimits `json:"rate_limits,omitempty"` + UsageTrackingConfig []DataSourceServingEndpointsEndpointsAiGatewayUsageTrackingConfig `json:"usage_tracking_config,omitempty"` +} + +type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAi21LabsConfig struct { + Ai21LabsApiKey string `json:"ai21labs_api_key,omitempty"` + Ai21LabsApiKeyPlaintext string `json:"ai21labs_api_key_plaintext,omitempty"` +} + +type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAmazonBedrockConfig struct { + AwsAccessKeyId string `json:"aws_access_key_id,omitempty"` + AwsAccessKeyIdPlaintext string `json:"aws_access_key_id_plaintext,omitempty"` + AwsRegion string `json:"aws_region"` + AwsSecretAccessKey string `json:"aws_secret_access_key,omitempty"` + AwsSecretAccessKeyPlaintext string `json:"aws_secret_access_key_plaintext,omitempty"` + BedrockProvider string `json:"bedrock_provider"` +} + +type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAnthropicConfig struct { + AnthropicApiKey string `json:"anthropic_api_key,omitempty"` + AnthropicApiKeyPlaintext string `json:"anthropic_api_key_plaintext,omitempty"` +} + +type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelCohereConfig struct { + CohereApiBase string `json:"cohere_api_base,omitempty"` + CohereApiKey string `json:"cohere_api_key,omitempty"` + CohereApiKeyPlaintext string `json:"cohere_api_key_plaintext,omitempty"` +} + +type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelDatabricksModelServingConfig struct { + DatabricksApiToken string `json:"databricks_api_token,omitempty"` + DatabricksApiTokenPlaintext string `json:"databricks_api_token_plaintext,omitempty"` + DatabricksWorkspaceUrl string `json:"databricks_workspace_url"` +} + +type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelGoogleCloudVertexAiConfig struct { + PrivateKey string `json:"private_key,omitempty"` + PrivateKeyPlaintext string `json:"private_key_plaintext,omitempty"` + ProjectId string `json:"project_id,omitempty"` + Region string `json:"region,omitempty"` +} + +type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelOpenaiConfig struct { + MicrosoftEntraClientId string `json:"microsoft_entra_client_id,omitempty"` + MicrosoftEntraClientSecret string `json:"microsoft_entra_client_secret,omitempty"` + MicrosoftEntraClientSecretPlaintext string `json:"microsoft_entra_client_secret_plaintext,omitempty"` + MicrosoftEntraTenantId string `json:"microsoft_entra_tenant_id,omitempty"` + OpenaiApiBase string `json:"openai_api_base,omitempty"` + OpenaiApiKey string `json:"openai_api_key,omitempty"` + OpenaiApiKeyPlaintext string `json:"openai_api_key_plaintext,omitempty"` + OpenaiApiType string `json:"openai_api_type,omitempty"` + OpenaiApiVersion string `json:"openai_api_version,omitempty"` + OpenaiDeploymentName string `json:"openai_deployment_name,omitempty"` + OpenaiOrganization string `json:"openai_organization,omitempty"` +} + +type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelPalmConfig struct { + PalmApiKey string `json:"palm_api_key,omitempty"` + PalmApiKeyPlaintext string `json:"palm_api_key_plaintext,omitempty"` +} + +type DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModel struct { + Ai21LabsConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAi21LabsConfig `json:"ai21labs_config,omitempty"` + AmazonBedrockConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAmazonBedrockConfig `json:"amazon_bedrock_config,omitempty"` + AnthropicConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelAnthropicConfig `json:"anthropic_config,omitempty"` + CohereConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelCohereConfig `json:"cohere_config,omitempty"` + DatabricksModelServingConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelDatabricksModelServingConfig `json:"databricks_model_serving_config,omitempty"` + GoogleCloudVertexAiConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelGoogleCloudVertexAiConfig `json:"google_cloud_vertex_ai_config,omitempty"` + Name string `json:"name"` + OpenaiConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelOpenaiConfig `json:"openai_config,omitempty"` + PalmConfig []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModelPalmConfig `json:"palm_config,omitempty"` + Provider string `json:"provider"` + Task string `json:"task"` +} + +type DataSourceServingEndpointsEndpointsConfigServedEntitiesFoundationModel struct { + Description string `json:"description,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Docs string `json:"docs,omitempty"` + Name string `json:"name,omitempty"` +} + +type DataSourceServingEndpointsEndpointsConfigServedEntities struct { + EntityName string `json:"entity_name,omitempty"` + EntityVersion string `json:"entity_version,omitempty"` + ExternalModel []DataSourceServingEndpointsEndpointsConfigServedEntitiesExternalModel `json:"external_model,omitempty"` + FoundationModel []DataSourceServingEndpointsEndpointsConfigServedEntitiesFoundationModel `json:"foundation_model,omitempty"` + Name string `json:"name,omitempty"` +} + +type DataSourceServingEndpointsEndpointsConfigServedModels struct { + ModelName string `json:"model_name,omitempty"` + ModelVersion string `json:"model_version,omitempty"` + Name string `json:"name,omitempty"` +} + +type DataSourceServingEndpointsEndpointsConfig struct { + ServedEntities []DataSourceServingEndpointsEndpointsConfigServedEntities `json:"served_entities,omitempty"` + ServedModels []DataSourceServingEndpointsEndpointsConfigServedModels `json:"served_models,omitempty"` +} + +type DataSourceServingEndpointsEndpointsState struct { + ConfigUpdate string `json:"config_update,omitempty"` + Ready string `json:"ready,omitempty"` +} + +type DataSourceServingEndpointsEndpointsTags struct { + Key string `json:"key"` + Value string `json:"value,omitempty"` +} + +type DataSourceServingEndpointsEndpoints struct { + AiGateway []DataSourceServingEndpointsEndpointsAiGateway `json:"ai_gateway,omitempty"` + Config []DataSourceServingEndpointsEndpointsConfig `json:"config,omitempty"` + CreationTimestamp int `json:"creation_timestamp,omitempty"` + Creator string `json:"creator,omitempty"` + Id string `json:"id,omitempty"` + LastUpdatedTimestamp int `json:"last_updated_timestamp,omitempty"` + Name string `json:"name,omitempty"` + State []DataSourceServingEndpointsEndpointsState `json:"state,omitempty"` + Tags []DataSourceServingEndpointsEndpointsTags `json:"tags,omitempty"` + Task string `json:"task,omitempty"` +} + type DataSourceServingEndpoints struct { - Endpoints any `json:"endpoints,omitempty"` + Endpoints []DataSourceServingEndpointsEndpoints `json:"endpoints,omitempty"` } diff --git a/bundle/internal/tf/schema/resource_app.go b/bundle/internal/tf/schema/resource_app.go index 5ba1d26d82..14c93b7937 100644 --- a/bundle/internal/tf/schema/resource_app.go +++ b/bundle/internal/tf/schema/resource_app.go @@ -2,21 +2,101 @@ package schema +type ResourceAppActiveDeploymentDeploymentArtifacts struct { + SourceCodePath string `json:"source_code_path,omitempty"` +} + +type ResourceAppActiveDeploymentStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type ResourceAppActiveDeployment struct { + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` + DeploymentArtifacts *ResourceAppActiveDeploymentDeploymentArtifacts `json:"deployment_artifacts,omitempty"` + DeploymentId string `json:"deployment_id,omitempty"` + Mode string `json:"mode,omitempty"` + SourceCodePath string `json:"source_code_path,omitempty"` + Status *ResourceAppActiveDeploymentStatus `json:"status,omitempty"` + UpdateTime string `json:"update_time,omitempty"` +} + +type ResourceAppAppStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type ResourceAppComputeStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type ResourceAppPendingDeploymentDeploymentArtifacts struct { + SourceCodePath string `json:"source_code_path,omitempty"` +} + +type ResourceAppPendingDeploymentStatus struct { + Message string `json:"message,omitempty"` + State string `json:"state,omitempty"` +} + +type ResourceAppPendingDeployment struct { + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` + DeploymentArtifacts *ResourceAppPendingDeploymentDeploymentArtifacts `json:"deployment_artifacts,omitempty"` + DeploymentId string `json:"deployment_id,omitempty"` + Mode string `json:"mode,omitempty"` + SourceCodePath string `json:"source_code_path,omitempty"` + Status *ResourceAppPendingDeploymentStatus `json:"status,omitempty"` + UpdateTime string `json:"update_time,omitempty"` +} + +type ResourceAppResourcesJob struct { + Id string `json:"id"` + Permission string `json:"permission"` +} + +type ResourceAppResourcesSecret struct { + Key string `json:"key"` + Permission string `json:"permission"` + Scope string `json:"scope"` +} + +type ResourceAppResourcesServingEndpoint struct { + Name string `json:"name"` + Permission string `json:"permission"` +} + +type ResourceAppResourcesSqlWarehouse struct { + Id string `json:"id"` + Permission string `json:"permission"` +} + +type ResourceAppResources struct { + Description string `json:"description,omitempty"` + Job *ResourceAppResourcesJob `json:"job,omitempty"` + Name string `json:"name"` + Secret *ResourceAppResourcesSecret `json:"secret,omitempty"` + ServingEndpoint *ResourceAppResourcesServingEndpoint `json:"serving_endpoint,omitempty"` + SqlWarehouse *ResourceAppResourcesSqlWarehouse `json:"sql_warehouse,omitempty"` +} + type ResourceApp struct { - ActiveDeployment any `json:"active_deployment,omitempty"` - AppStatus any `json:"app_status,omitempty"` - ComputeStatus any `json:"compute_status,omitempty"` - CreateTime string `json:"create_time,omitempty"` - Creator string `json:"creator,omitempty"` - DefaultSourceCodePath string `json:"default_source_code_path,omitempty"` - Description string `json:"description,omitempty"` - Name string `json:"name"` - PendingDeployment any `json:"pending_deployment,omitempty"` - Resources any `json:"resources,omitempty"` - ServicePrincipalClientId string `json:"service_principal_client_id,omitempty"` - ServicePrincipalId int `json:"service_principal_id,omitempty"` - ServicePrincipalName string `json:"service_principal_name,omitempty"` - UpdateTime string `json:"update_time,omitempty"` - Updater string `json:"updater,omitempty"` - Url string `json:"url,omitempty"` + ActiveDeployment *ResourceAppActiveDeployment `json:"active_deployment,omitempty"` + AppStatus *ResourceAppAppStatus `json:"app_status,omitempty"` + ComputeStatus *ResourceAppComputeStatus `json:"compute_status,omitempty"` + CreateTime string `json:"create_time,omitempty"` + Creator string `json:"creator,omitempty"` + DefaultSourceCodePath string `json:"default_source_code_path,omitempty"` + Description string `json:"description,omitempty"` + Name string `json:"name"` + PendingDeployment *ResourceAppPendingDeployment `json:"pending_deployment,omitempty"` + Resources []ResourceAppResources `json:"resources,omitempty"` + ServicePrincipalClientId string `json:"service_principal_client_id,omitempty"` + ServicePrincipalId int `json:"service_principal_id,omitempty"` + ServicePrincipalName string `json:"service_principal_name,omitempty"` + UpdateTime string `json:"update_time,omitempty"` + Updater string `json:"updater,omitempty"` + Url string `json:"url,omitempty"` } diff --git a/bundle/internal/tf/schema/resource_quality_monitor.go b/bundle/internal/tf/schema/resource_quality_monitor.go index 61d18e9303..0fc2abd666 100644 --- a/bundle/internal/tf/schema/resource_quality_monitor.go +++ b/bundle/internal/tf/schema/resource_quality_monitor.go @@ -33,8 +33,8 @@ type ResourceQualityMonitorNotificationsOnNewClassificationTagDetected struct { } type ResourceQualityMonitorNotifications struct { - OnFailure []ResourceQualityMonitorNotificationsOnFailure `json:"on_failure,omitempty"` - OnNewClassificationTagDetected []ResourceQualityMonitorNotificationsOnNewClassificationTagDetected `json:"on_new_classification_tag_detected,omitempty"` + OnFailure *ResourceQualityMonitorNotificationsOnFailure `json:"on_failure,omitempty"` + OnNewClassificationTagDetected *ResourceQualityMonitorNotificationsOnNewClassificationTagDetected `json:"on_new_classification_tag_detected,omitempty"` } type ResourceQualityMonitorSchedule struct { @@ -52,25 +52,25 @@ type ResourceQualityMonitorTimeSeries struct { } type ResourceQualityMonitor struct { - AssetsDir string `json:"assets_dir"` - BaselineTableName string `json:"baseline_table_name,omitempty"` - DashboardId string `json:"dashboard_id,omitempty"` - DriftMetricsTableName string `json:"drift_metrics_table_name,omitempty"` - Id string `json:"id,omitempty"` - LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` - MonitorVersion string `json:"monitor_version,omitempty"` - OutputSchemaName string `json:"output_schema_name"` - ProfileMetricsTableName string `json:"profile_metrics_table_name,omitempty"` - SkipBuiltinDashboard bool `json:"skip_builtin_dashboard,omitempty"` - SlicingExprs []string `json:"slicing_exprs,omitempty"` - Status string `json:"status,omitempty"` - TableName string `json:"table_name"` - WarehouseId string `json:"warehouse_id,omitempty"` - CustomMetrics []ResourceQualityMonitorCustomMetrics `json:"custom_metrics,omitempty"` - DataClassificationConfig []ResourceQualityMonitorDataClassificationConfig `json:"data_classification_config,omitempty"` - InferenceLog []ResourceQualityMonitorInferenceLog `json:"inference_log,omitempty"` - Notifications []ResourceQualityMonitorNotifications `json:"notifications,omitempty"` - Schedule []ResourceQualityMonitorSchedule `json:"schedule,omitempty"` - Snapshot []ResourceQualityMonitorSnapshot `json:"snapshot,omitempty"` - TimeSeries []ResourceQualityMonitorTimeSeries `json:"time_series,omitempty"` + AssetsDir string `json:"assets_dir"` + BaselineTableName string `json:"baseline_table_name,omitempty"` + DashboardId string `json:"dashboard_id,omitempty"` + DriftMetricsTableName string `json:"drift_metrics_table_name,omitempty"` + Id string `json:"id,omitempty"` + LatestMonitorFailureMsg string `json:"latest_monitor_failure_msg,omitempty"` + MonitorVersion string `json:"monitor_version,omitempty"` + OutputSchemaName string `json:"output_schema_name"` + ProfileMetricsTableName string `json:"profile_metrics_table_name,omitempty"` + SkipBuiltinDashboard bool `json:"skip_builtin_dashboard,omitempty"` + SlicingExprs []string `json:"slicing_exprs,omitempty"` + Status string `json:"status,omitempty"` + TableName string `json:"table_name"` + WarehouseId string `json:"warehouse_id,omitempty"` + CustomMetrics []ResourceQualityMonitorCustomMetrics `json:"custom_metrics,omitempty"` + DataClassificationConfig *ResourceQualityMonitorDataClassificationConfig `json:"data_classification_config,omitempty"` + InferenceLog *ResourceQualityMonitorInferenceLog `json:"inference_log,omitempty"` + Notifications *ResourceQualityMonitorNotifications `json:"notifications,omitempty"` + Schedule *ResourceQualityMonitorSchedule `json:"schedule,omitempty"` + Snapshot *ResourceQualityMonitorSnapshot `json:"snapshot,omitempty"` + TimeSeries *ResourceQualityMonitorTimeSeries `json:"time_series,omitempty"` } From 2300a5755ed64498a3a556a45196cdb53c1e9732 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Fri, 13 Dec 2024 15:06:50 +0100 Subject: [PATCH 3/3] small updates --- bundle/internal/tf/codegen/generator/walker.go | 1 - bundle/internal/tf/codegen/templates/root.go.tmpl | 6 +++--- bundle/internal/tf/schema/root.go | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bundle/internal/tf/codegen/generator/walker.go b/bundle/internal/tf/codegen/generator/walker.go index 67525a6e37..0e9d73c4e5 100644 --- a/bundle/internal/tf/codegen/generator/walker.go +++ b/bundle/internal/tf/codegen/generator/walker.go @@ -81,7 +81,6 @@ func nestedField(name []string, k string, isRef bool) field { fieldType := fmt.Sprintf("%s%s", fieldTypePrefix, strings.Join(append(name, strcase.ToCamel(k)), "")) fieldTag := fmt.Sprintf("%s,omitempty", k) - // Append to list of fields for type. return field{ Name: fieldName, Type: fieldType, diff --git a/bundle/internal/tf/codegen/templates/root.go.tmpl b/bundle/internal/tf/codegen/templates/root.go.tmpl index e03e978f08..b5c53c1615 100644 --- a/bundle/internal/tf/codegen/templates/root.go.tmpl +++ b/bundle/internal/tf/codegen/templates/root.go.tmpl @@ -25,9 +25,9 @@ const ProviderVersion = "{{ .ProviderVersion }}" func NewRoot() *Root { return &Root{ - Terraform: map[string]interface{}{ - "required_providers": map[string]interface{}{ - "databricks": map[string]interface{}{ + Terraform: map[string]any{ + "required_providers": map[string]any{ + "databricks": map[string]any{ "source": ProviderSource, "version": ProviderVersion, }, diff --git a/bundle/internal/tf/schema/root.go b/bundle/internal/tf/schema/root.go index 8682b70527..6befba596c 100644 --- a/bundle/internal/tf/schema/root.go +++ b/bundle/internal/tf/schema/root.go @@ -25,9 +25,9 @@ const ProviderVersion = "1.61.0" func NewRoot() *Root { return &Root{ - Terraform: map[string]interface{}{ - "required_providers": map[string]interface{}{ - "databricks": map[string]interface{}{ + Terraform: map[string]any{ + "required_providers": map[string]any{ + "databricks": map[string]any{ "source": ProviderSource, "version": ProviderVersion, },