diff --git a/resources/dw/virtualwarehouse/hive/model_hive_vw.go b/resources/dw/virtualwarehouse/hive/model_hive_vw.go index 0bfc2137..85b98463 100644 --- a/resources/dw/virtualwarehouse/hive/model_hive_vw.go +++ b/resources/dw/virtualwarehouse/hive/model_hive_vw.go @@ -20,48 +20,40 @@ import ( "github.com/cloudera/terraform-provider-cdp/utils" ) -type autoscaling struct { - MinClusters types.Int64 `tfsdk:"min_clusters"` - MaxClusters types.Int64 `tfsdk:"max_clusters"` - DisableAutoSuspend types.Bool `tfsdk:"disable_auto_suspend"` - AutoSuspendTimeoutSeconds types.Int64 `tfsdk:"auto_suspend_timeout_seconds"` - HiveScaleWaitTimeSeconds types.Int64 `tfsdk:"hive_scale_wait_time_seconds"` - HiveDesiredFreeCapacity types.Int64 `tfsdk:"hive_desired_free_capacity"` -} - type awsOptions struct { AvailabilityZone types.String `tfsdk:"availability_zone"` EbsLLAPSpillGb types.Int64 `tfsdk:"ebs_llap_spill_gb"` Tags types.Map `tfsdk:"tags"` } -type queryIsolationOptions struct { - MaxQueries types.Int64 `tfsdk:"max_queries"` - MaxNodesPerQuery types.Int64 `tfsdk:"max_nodes_per_query"` -} - type resourceModel struct { - ID types.String `tfsdk:"id"` - ClusterID types.String `tfsdk:"cluster_id"` - DatabaseCatalogID types.String `tfsdk:"database_catalog_id"` - Name types.String `tfsdk:"name"` - ImageVersion types.String `tfsdk:"image_version"` - NodeCount types.Int64 `tfsdk:"node_count"` - PlatformJwtAuth types.Bool `tfsdk:"platform_jwt_auth"` - LdapGroups types.List `tfsdk:"ldap_groups"` - EnableSSO types.Bool `tfsdk:"enable_sso"` - Compactor types.Bool `tfsdk:"compactor"` - JdbcUrl types.String `tfsdk:"jdbc_url"` - KerberosJdbcUrl types.String `tfsdk:"kerberos_jdbc_url"` - HueUrl types.String `tfsdk:"hue_url"` - JwtConnectionString types.String `tfsdk:"jwt_connection_string"` - JwtTokenGenUrl types.String `tfsdk:"jwt_token_gen_url"` - Autoscaling *autoscaling `tfsdk:"autoscaling"` - AwsOptions *awsOptions `tfsdk:"aws_options"` - QueryIsolationOptions *queryIsolationOptions `tfsdk:"query_isolation_options"` - LastUpdated types.String `tfsdk:"last_updated"` - Status types.String `tfsdk:"status"` - PollingOptions *utils.PollingOptions `tfsdk:"polling_options"` + ID types.String `tfsdk:"id"` + ClusterID types.String `tfsdk:"cluster_id"` + DatabaseCatalogID types.String `tfsdk:"database_catalog_id"` + Name types.String `tfsdk:"name"` + ImageVersion types.String `tfsdk:"image_version"` + GroupSize types.Int64 `tfsdk:"group_size"` + PlatformJwtAuth types.Bool `tfsdk:"platform_jwt_auth"` + LdapGroups types.List `tfsdk:"ldap_groups"` + EnableSSO types.Bool `tfsdk:"enable_sso"` + Compactor types.Bool `tfsdk:"compactor"` + JdbcUrl types.String `tfsdk:"jdbc_url"` + KerberosJdbcUrl types.String `tfsdk:"kerberos_jdbc_url"` + HueUrl types.String `tfsdk:"hue_url"` + JwtConnectionString types.String `tfsdk:"jwt_connection_string"` + JwtTokenGenUrl types.String `tfsdk:"jwt_token_gen_url"` + MinGroupCount types.Int64 `tfsdk:"min_group_count"` + MaxGroupCount types.Int64 `tfsdk:"max_group_count"` + DisableAutoSuspend types.Bool `tfsdk:"disable_auto_suspend"` + AutoSuspendTimeoutSeconds types.Int64 `tfsdk:"auto_suspend_timeout_seconds"` + ScaleWaitTimeSeconds types.Int64 `tfsdk:"scale_wait_time_seconds"` + Headroom types.Int64 `tfsdk:"headroom"` + MaxConcurrentIsolatedQueries types.Int64 `tfsdk:"max_concurrent_isolated_queries"` + MaxNodesPerIsolatedQuery types.Int64 `tfsdk:"max_nodes_per_isolated_query"` + AwsOptions *awsOptions `tfsdk:"aws_options"` + LastUpdated types.String `tfsdk:"last_updated"` + Status types.String `tfsdk:"status"` + PollingOptions *utils.PollingOptions `tfsdk:"polling_options"` } func (p *resourceModel) GetPollingOptions() *utils.PollingOptions { @@ -76,7 +68,7 @@ func (p *resourceModel) convertToCreateVwRequest() *models.CreateVwRequest { EbsLLAPSpillGB: p.getEbsLLAPSpillGB(), ImageVersion: p.getImageVersion(), Name: p.Name.ValueStringPointer(), - NodeCount: utils.Int64To32(p.NodeCount), + NodeCount: utils.Int64To32(p.GroupSize), PlatformJwtAuth: p.PlatformJwtAuth.ValueBoolPointer(), QueryIsolationOptions: p.getQueryIsolationOptions(), Autoscaling: p.getAutoscaling(), @@ -122,12 +114,9 @@ func (p *resourceModel) getTags() []*models.TagRequest { } func (p *resourceModel) getQueryIsolationOptions() *models.QueryIsolationOptionsRequest { - if p.QueryIsolationOptions == nil { - return nil - } return &models.QueryIsolationOptionsRequest{ - MaxQueries: utils.Int64To32(p.QueryIsolationOptions.MaxQueries), - MaxNodesPerQuery: utils.Int64To32(p.QueryIsolationOptions.MaxNodesPerQuery), + MaxQueries: utils.Int64To32(p.MaxConcurrentIsolatedQueries), + MaxNodesPerQuery: utils.Int64To32(p.MaxNodesPerIsolatedQuery), } } @@ -146,16 +135,13 @@ func (p *resourceModel) getEbsLLAPSpillGB() int32 { } func (p *resourceModel) getAutoscaling() *models.AutoscalingOptionsCreateRequest { - if p.Autoscaling == nil { - return nil - } return &models.AutoscalingOptionsCreateRequest{ - MinClusters: utils.Int64To32Pointer(p.Autoscaling.MinClusters), - MaxClusters: utils.Int64To32Pointer(p.Autoscaling.MaxClusters), - DisableAutoSuspend: p.Autoscaling.DisableAutoSuspend.ValueBool(), - AutoSuspendTimeoutSeconds: utils.Int64To32(p.Autoscaling.AutoSuspendTimeoutSeconds), - HiveScaleWaitTimeSeconds: utils.Int64To32(p.Autoscaling.HiveScaleWaitTimeSeconds), - HiveDesiredFreeCapacity: utils.Int64To32(p.Autoscaling.HiveDesiredFreeCapacity), + MinClusters: utils.Int64To32Pointer(p.MinGroupCount), + MaxClusters: utils.Int64To32Pointer(p.MaxGroupCount), + DisableAutoSuspend: p.DisableAutoSuspend.ValueBool(), + AutoSuspendTimeoutSeconds: utils.Int64To32(p.AutoSuspendTimeoutSeconds), + HiveScaleWaitTimeSeconds: utils.Int64To32(p.ScaleWaitTimeSeconds), + HiveDesiredFreeCapacity: utils.Int64To32(p.Headroom), } } diff --git a/resources/dw/virtualwarehouse/hive/resource_hive_vw_acc_test.go b/resources/dw/virtualwarehouse/hive/resource_hive_vw_acc_test.go index 0a4fc976..a234f5e0 100644 --- a/resources/dw/virtualwarehouse/hive/resource_hive_vw_acc_test.go +++ b/resources/dw/virtualwarehouse/hive/resource_hive_vw_acc_test.go @@ -69,9 +69,7 @@ func TestAccHive_basic(t *testing.T) { resource.TestCheckResourceAttr("cdp_dw_vw_hive.test_hive", "database_catalog_id", params.DatabaseCatalogID), resource.TestCheckResourceAttrSet("cdp_dw_vw_hive.test_hive", "compactor"), resource.TestCheckResourceAttrSet("cdp_dw_vw_hive.test_hive", "jdbc_url"), - resource.TestCheckResourceAttrSet("cdp_dw_vw_hive.test_hive", "kerberos_jdbc_url"), resource.TestCheckResourceAttrSet("cdp_dw_vw_hive.test_hive", "hue_url"), - resource.TestCheckResourceAttrSet("cdp_dw_vw_hive.test_hive", "jwt_connection_string"), resource.TestCheckResourceAttrSet("cdp_dw_vw_hive.test_hive", "jwt_token_gen_url"), ), }, @@ -86,16 +84,16 @@ func testAccHiveBasicConfig(params hiveTestParameters) string { cluster_id = %[1]q database_catalog_id = %[2]q name = %[3]q - node_count = 2 + group_size = 2 platform_jwt_auth = true enable_sso = true - autoscaling = { - min_clusters = 2 - max_clusters = 5 - disable_auto_suspend = false - auto_suspend_timeout_seconds = 100 - hive_scale_wait_time_seconds = 230 - } + min_group_count = 2 + max_group_count = 5 + disable_auto_suspend = false + auto_suspend_timeout_seconds = 100 + scale_wait_time_seconds = 230 + max_concurrent_isolated_queries = 10 + max_nodes_per_isolated_query = 10 aws_options = { availability_zone = "us-west-2a" ebs_llap_spill_gb = 300 @@ -103,10 +101,6 @@ func testAccHiveBasicConfig(params hiveTestParameters) string { owner = "cdw-terraform@cloudera.com" } } - query_isolation_options = { - max_queries = 100 - max_nodes_per_query = 10 - } } `, params.ClusterID, params.DatabaseCatalogID, params.Name) } diff --git a/resources/dw/virtualwarehouse/hive/resource_hive_vw_test.go b/resources/dw/virtualwarehouse/hive/resource_hive_vw_test.go index c8e3c617..86225de0 100644 --- a/resources/dw/virtualwarehouse/hive/resource_hive_vw_test.go +++ b/resources/dw/virtualwarehouse/hive/resource_hive_vw_test.go @@ -69,9 +69,9 @@ var testHiveSchema = schema.Schema{ Computed: true, MarkdownDescription: "The version of the Hive Virtual Warehouse image.", }, - "node_count": schema.Int64Attribute{ + "group_size": schema.Int64Attribute{ Optional: true, - MarkdownDescription: "Nodes per compute cluster. If specified, forces ‘template’ to be ‘custom’.", + MarkdownDescription: "Nodes per compute group. If specified, forces ‘template’ to be ‘custom’.", }, "platform_jwt_auth": schema.BoolAttribute{ Optional: true, @@ -114,37 +114,39 @@ var testHiveSchema = schema.Schema{ Computed: true, MarkdownDescription: "URL to generate JWT tokens for the Virtual Warehouse by the CDP JWT token provider. Available if platform JWT authentication is enabled.", }, - "autoscaling": schema.SingleNestedAttribute{ - MarkdownDescription: "Autoscaling related configuration options that could specify various values that will be used during CDW resource creation.", + "min_group_count": schema.Int64Attribute{ + Required: true, + MarkdownDescription: "Minimum number of available compute groups.", + }, + "max_group_count": schema.Int64Attribute{ + Required: true, + MarkdownDescription: "Maximum number of available compute groups.", + }, + "disable_auto_suspend": schema.BoolAttribute{ Optional: true, - Attributes: map[string]schema.Attribute{ - "min_clusters": schema.Int64Attribute{ - Required: true, - MarkdownDescription: "Minimum number of available compute groups.", - }, - "max_clusters": schema.Int64Attribute{ - Required: true, - MarkdownDescription: "Maximum number of available compute groups.", - }, - "disable_auto_suspend": schema.BoolAttribute{ - Optional: true, - Computed: true, - Default: booldefault.StaticBool(false), - MarkdownDescription: "Boolean value that specifies if auto-suspend should be disabled.", - }, - "auto_suspend_timeout_seconds": schema.Int64Attribute{ - Optional: true, - MarkdownDescription: "The time in seconds after which the compute group should be suspended.", - }, - "hive_scale_wait_time_seconds": schema.Int64Attribute{ - Optional: true, - MarkdownDescription: "Set wait time before a scale event happens. Either “hiveScaleWaitTimeSeconds” or “hiveDesiredFreeCapacity” can be provided.", - }, - "hive_desired_free_capacity": schema.Int64Attribute{ - Optional: true, - MarkdownDescription: "Set Desired free capacity. Either “hiveScaleWaitTimeSeconds” or “hiveDesiredFreeCapacity” can be provided.", - }, - }, + Computed: true, + Default: booldefault.StaticBool(false), + MarkdownDescription: "Boolean value that specifies if auto-suspend should be disabled.", + }, + "auto_suspend_timeout_seconds": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "The time in seconds after which the compute group should be suspended.", + }, + "scale_wait_time_seconds": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Set wait time before a scale event happens. Either “scale_wait_time_in_seconds” or “headroom” can be provided.", + }, + "headroom": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Set headroom node count. Nodes will be started in case there are no free nodes left to pick up new jobs. Either “scale_wait_time_in_seconds” or “headroom” can be provided.", + }, + "max_concurrent_isolated_queries": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Maximum number of concurrent isolated queries. If not provided, 0 will be applied. The 0 value means the query isolation functionality will be disabled.", + }, + "max_nodes_per_isolated_query": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Maximum number of nodes per isolated query. If not provided, 0 will be applied. The 0 value means the query isolation functionality will be disabled.", }, "aws_options": schema.SingleNestedAttribute{ MarkdownDescription: "AWS related configuration options that could specify various values that will be used during CDW resource creation.", @@ -166,20 +168,6 @@ var testHiveSchema = schema.Schema{ }, }, }, - "query_isolation_options": schema.SingleNestedAttribute{ - MarkdownDescription: "Query isolation related configuration options.", - Optional: true, - Attributes: map[string]schema.Attribute{ - "max_queries": schema.Int64Attribute{ - Optional: true, - MarkdownDescription: "Maximum number of concurrent isolated queries. If not provided, 0 will be applied. The 0 value means the query isolation functionality will be disabled.", - }, - "max_nodes_per_query": schema.Int64Attribute{ - Optional: true, - MarkdownDescription: "Maximum number of nodes per isolated query. If not provided, 0 will be applied. The 0 value means the query isolation functionality will be disabled.", - }, - }, - }, "last_updated": schema.StringAttribute{ Computed: true, MarkdownDescription: "Timestamp of the last Terraform update of the order.", @@ -240,28 +228,26 @@ func createRawHiveResource() tftypes.Value { "database_catalog_id": tftypes.String, "name": tftypes.String, "image_version": tftypes.String, - "node_count": tftypes.Number, + "group_size": tftypes.Number, "platform_jwt_auth": tftypes.Bool, "ldap_groups": tftypes.List{ ElementType: tftypes.String, }, - "enable_sso": tftypes.Bool, - "compactor": tftypes.Bool, - "jdbc_url": tftypes.String, - "kerberos_jdbc_url": tftypes.String, - "hue_url": tftypes.String, - "jwt_connection_string": tftypes.String, - "jwt_token_gen_url": tftypes.String, - "autoscaling": tftypes.Object{ - AttributeTypes: map[string]tftypes.Type{ - "min_clusters": tftypes.Number, - "max_clusters": tftypes.Number, - "disable_auto_suspend": tftypes.Bool, - "auto_suspend_timeout_seconds": tftypes.Number, - "hive_scale_wait_time_seconds": tftypes.Number, - "hive_desired_free_capacity": tftypes.Number, - }, - }, + "enable_sso": tftypes.Bool, + "compactor": tftypes.Bool, + "jdbc_url": tftypes.String, + "kerberos_jdbc_url": tftypes.String, + "hue_url": tftypes.String, + "jwt_connection_string": tftypes.String, + "jwt_token_gen_url": tftypes.String, + "min_group_count": tftypes.Number, + "max_group_count": tftypes.Number, + "disable_auto_suspend": tftypes.Bool, + "auto_suspend_timeout_seconds": tftypes.Number, + "scale_wait_time_seconds": tftypes.Number, + "headroom": tftypes.Number, + "max_concurrent_isolated_queries": tftypes.Number, + "max_nodes_per_isolated_query": tftypes.Number, "aws_options": tftypes.Object{ AttributeTypes: map[string]tftypes.Type{ "availability_zone": tftypes.String, @@ -269,12 +255,6 @@ func createRawHiveResource() tftypes.Value { "tags": tftypes.Map{ElementType: tftypes.String}, }, }, - "query_isolation_options": tftypes.Object{ - AttributeTypes: map[string]tftypes.Type{ - "max_queries": tftypes.Number, - "max_nodes_per_query": tftypes.Number, - }, - }, "last_updated": tftypes.String, "status": tftypes.String, "polling_options": tftypes.Object{ @@ -286,38 +266,29 @@ func createRawHiveResource() tftypes.Value { }, }}, map[string]tftypes.Value{ - "id": tftypes.NewValue(tftypes.String, ""), - "cluster_id": tftypes.NewValue(tftypes.String, "cluster-id"), - "database_catalog_id": tftypes.NewValue(tftypes.String, "database-catalog-id"), - "name": tftypes.NewValue(tftypes.String, ""), - "image_version": tftypes.NewValue(tftypes.String, ""), - "node_count": tftypes.NewValue(tftypes.Number, 10), - "platform_jwt_auth": tftypes.NewValue(tftypes.Bool, true), - "ldap_groups": tftypes.NewValue(tftypes.List{ElementType: tftypes.String}, []tftypes.Value{}), - "enable_sso": tftypes.NewValue(tftypes.Bool, true), - "compactor": tftypes.NewValue(tftypes.Bool, false), - "jdbc_url": tftypes.NewValue(tftypes.String, ""), - "kerberos_jdbc_url": tftypes.NewValue(tftypes.String, ""), - "hue_url": tftypes.NewValue(tftypes.String, ""), - "jwt_connection_string": tftypes.NewValue(tftypes.String, ""), - "jwt_token_gen_url": tftypes.NewValue(tftypes.String, ""), - "autoscaling": tftypes.NewValue( - tftypes.Object{ - AttributeTypes: map[string]tftypes.Type{ - "min_clusters": tftypes.Number, - "max_clusters": tftypes.Number, - "disable_auto_suspend": tftypes.Bool, - "auto_suspend_timeout_seconds": tftypes.Number, - "hive_scale_wait_time_seconds": tftypes.Number, - "hive_desired_free_capacity": tftypes.Number, - }}, map[string]tftypes.Value{ - "min_clusters": tftypes.NewValue(tftypes.Number, 1), - "max_clusters": tftypes.NewValue(tftypes.Number, 10), - "disable_auto_suspend": tftypes.NewValue(tftypes.Bool, false), - "auto_suspend_timeout_seconds": tftypes.NewValue(tftypes.Number, 60), - "hive_scale_wait_time_seconds": tftypes.NewValue(tftypes.Number, 60), - "hive_desired_free_capacity": tftypes.NewValue(tftypes.Number, 10), - }), + "id": tftypes.NewValue(tftypes.String, ""), + "cluster_id": tftypes.NewValue(tftypes.String, "cluster-id"), + "database_catalog_id": tftypes.NewValue(tftypes.String, "database-catalog-id"), + "name": tftypes.NewValue(tftypes.String, ""), + "image_version": tftypes.NewValue(tftypes.String, ""), + "group_size": tftypes.NewValue(tftypes.Number, 10), + "platform_jwt_auth": tftypes.NewValue(tftypes.Bool, true), + "ldap_groups": tftypes.NewValue(tftypes.List{ElementType: tftypes.String}, []tftypes.Value{}), + "enable_sso": tftypes.NewValue(tftypes.Bool, true), + "compactor": tftypes.NewValue(tftypes.Bool, false), + "jdbc_url": tftypes.NewValue(tftypes.String, ""), + "kerberos_jdbc_url": tftypes.NewValue(tftypes.String, ""), + "hue_url": tftypes.NewValue(tftypes.String, ""), + "jwt_connection_string": tftypes.NewValue(tftypes.String, ""), + "jwt_token_gen_url": tftypes.NewValue(tftypes.String, ""), + "min_group_count": tftypes.NewValue(tftypes.Number, 1), + "max_group_count": tftypes.NewValue(tftypes.Number, 10), + "disable_auto_suspend": tftypes.NewValue(tftypes.Bool, false), + "auto_suspend_timeout_seconds": tftypes.NewValue(tftypes.Number, 60), + "scale_wait_time_seconds": tftypes.NewValue(tftypes.Number, 60), + "headroom": tftypes.NewValue(tftypes.Number, 10), + "max_concurrent_isolated_queries": tftypes.NewValue(tftypes.Number, 10), + "max_nodes_per_isolated_query": tftypes.NewValue(tftypes.Number, 10), "aws_options": tftypes.NewValue( tftypes.Object{ AttributeTypes: map[string]tftypes.Type{ @@ -332,15 +303,6 @@ func createRawHiveResource() tftypes.Value { "owner": tftypes.NewValue(tftypes.String, "dw-terraform@cloudera.com"), }), }), - "query_isolation_options": tftypes.NewValue( - tftypes.Object{ - AttributeTypes: map[string]tftypes.Type{ - "max_queries": tftypes.Number, - "max_nodes_per_query": tftypes.Number, - }}, map[string]tftypes.Value{ - "max_queries": tftypes.NewValue(tftypes.Number, 10), - "max_nodes_per_query": tftypes.NewValue(tftypes.Number, 10), - }), "last_updated": tftypes.NewValue(tftypes.String, ""), "status": tftypes.NewValue(tftypes.String, "Running"), "polling_options": tftypes.NewValue( @@ -595,31 +557,27 @@ func (suite *HiveTestSuite) TestStateRefresh_FailureThresholdReached() { func (suite *HiveTestSuite) TestConvertToCreateVwRequest_All() { plan := resourceModel{ - ClusterID: types.StringValue("cluster-id"), - DatabaseCatalogID: types.StringValue("database-catalog-id"), - Name: types.StringValue("test-name"), - ImageVersion: types.StringValue("2024.0.19.0-301"), - NodeCount: types.Int64Value(10), - PlatformJwtAuth: types.BoolValue(true), - LdapGroups: types.ListValueMust(types.StringType, []attr.Value{types.StringValue("ldap-group")}), - EnableSSO: types.BoolValue(true), - Autoscaling: &autoscaling{ - MinClusters: types.Int64Value(1), - MaxClusters: types.Int64Value(10), - DisableAutoSuspend: types.BoolValue(false), - AutoSuspendTimeoutSeconds: types.Int64Value(60), - HiveScaleWaitTimeSeconds: types.Int64Value(60), - HiveDesiredFreeCapacity: types.Int64Value(2), - }, + ClusterID: types.StringValue("cluster-id"), + DatabaseCatalogID: types.StringValue("database-catalog-id"), + Name: types.StringValue("test-name"), + ImageVersion: types.StringValue("2024.0.19.0-301"), + GroupSize: types.Int64Value(10), + PlatformJwtAuth: types.BoolValue(true), + LdapGroups: types.ListValueMust(types.StringType, []attr.Value{types.StringValue("ldap-group")}), + EnableSSO: types.BoolValue(true), + MinGroupCount: types.Int64Value(1), + MaxGroupCount: types.Int64Value(10), + DisableAutoSuspend: types.BoolValue(false), + AutoSuspendTimeoutSeconds: types.Int64Value(60), + ScaleWaitTimeSeconds: types.Int64Value(60), + Headroom: types.Int64Value(2), + MaxConcurrentIsolatedQueries: types.Int64Value(5), + MaxNodesPerIsolatedQuery: types.Int64Value(2), AwsOptions: &awsOptions{ AvailabilityZone: types.StringValue("us-west-2a"), EbsLLAPSpillGb: types.Int64Value(300), Tags: types.MapValueMust(types.StringType, map[string]attr.Value{"key1": types.StringValue("value1")}), }, - QueryIsolationOptions: &queryIsolationOptions{ - MaxQueries: types.Int64Value(5), - MaxNodesPerQuery: types.Int64Value(2), - }, } req := plan.convertToCreateVwRequest() @@ -649,7 +607,6 @@ func (suite *HiveTestSuite) TestConvertToCreateVwRequest_MissingImageVersion() { plan := resourceModel{ ImageVersion: types.StringUnknown(), AwsOptions: &awsOptions{}, - Autoscaling: &autoscaling{}, } req := plan.convertToCreateVwRequest() diff --git a/resources/dw/virtualwarehouse/hive/schema_hive_vw.go b/resources/dw/virtualwarehouse/hive/schema_hive_vw.go index 059525bb..bffdd468 100644 --- a/resources/dw/virtualwarehouse/hive/schema_hive_vw.go +++ b/resources/dw/virtualwarehouse/hive/schema_hive_vw.go @@ -52,9 +52,9 @@ var hiveSchema = schema.Schema{ Computed: true, MarkdownDescription: "The version of the Hive Virtual Warehouse image.", }, - "node_count": schema.Int64Attribute{ + "group_size": schema.Int64Attribute{ Optional: true, - MarkdownDescription: "Nodes per compute cluster. If specified, forces ‘template’ to be ‘custom’.", + MarkdownDescription: "Nodes per compute group. If specified, forces ‘template’ to be ‘custom’.", }, "platform_jwt_auth": schema.BoolAttribute{ Optional: true, @@ -97,37 +97,39 @@ var hiveSchema = schema.Schema{ Computed: true, MarkdownDescription: "URL to generate JWT tokens for the Virtual Warehouse by the CDP JWT token provider. Available if platform JWT authentication is enabled.", }, - "autoscaling": schema.SingleNestedAttribute{ - MarkdownDescription: "Autoscaling related configuration options that could specify various values that will be used during CDW resource creation.", + "min_group_count": schema.Int64Attribute{ + Required: true, + MarkdownDescription: "Minimum number of available compute groups.", + }, + "max_group_count": schema.Int64Attribute{ + Required: true, + MarkdownDescription: "Maximum number of available compute groups.", + }, + "disable_auto_suspend": schema.BoolAttribute{ Optional: true, - Attributes: map[string]schema.Attribute{ - "min_clusters": schema.Int64Attribute{ - Required: true, - MarkdownDescription: "Minimum number of available compute groups.", - }, - "max_clusters": schema.Int64Attribute{ - Required: true, - MarkdownDescription: "Maximum number of available compute groups.", - }, - "disable_auto_suspend": schema.BoolAttribute{ - Optional: true, - Computed: true, - Default: booldefault.StaticBool(false), - MarkdownDescription: "Boolean value that specifies if auto-suspend should be disabled.", - }, - "auto_suspend_timeout_seconds": schema.Int64Attribute{ - Optional: true, - MarkdownDescription: "The time in seconds after which the compute group should be suspended.", - }, - "hive_scale_wait_time_seconds": schema.Int64Attribute{ - Optional: true, - MarkdownDescription: "Set wait time before a scale event happens. Either “hiveScaleWaitTimeSeconds” or “hiveDesiredFreeCapacity” can be provided.", - }, - "hive_desired_free_capacity": schema.Int64Attribute{ - Optional: true, - MarkdownDescription: "Set Desired free capacity. Either “hiveScaleWaitTimeSeconds” or “hiveDesiredFreeCapacity” can be provided.", - }, - }, + Computed: true, + Default: booldefault.StaticBool(false), + MarkdownDescription: "Boolean value that specifies if auto-suspend should be disabled.", + }, + "auto_suspend_timeout_seconds": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "The time in seconds after which the compute group should be suspended.", + }, + "scale_wait_time_seconds": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Set wait time before a scale event happens. Either “scale_wait_time_in_seconds” or “headroom” can be provided.", + }, + "headroom": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Set headroom node count. Nodes will be started in case there are no free nodes left to pick up new jobs. Either “scale_wait_time_in_seconds” or “headroom” can be provided.", + }, + "max_concurrent_isolated_queries": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Maximum number of concurrent isolated queries. If not provided, 0 will be applied. The 0 value means the query isolation functionality will be disabled.", + }, + "max_nodes_per_isolated_query": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Maximum number of nodes per isolated query. If not provided, 0 will be applied. The 0 value means the query isolation functionality will be disabled.", }, "aws_options": schema.SingleNestedAttribute{ MarkdownDescription: "AWS related configuration options that could specify various values that will be used during CDW resource creation.", @@ -149,20 +151,6 @@ var hiveSchema = schema.Schema{ }, }, }, - "query_isolation_options": schema.SingleNestedAttribute{ - MarkdownDescription: "Query isolation related configuration options.", - Optional: true, - Attributes: map[string]schema.Attribute{ - "max_queries": schema.Int64Attribute{ - Optional: true, - MarkdownDescription: "Maximum number of concurrent isolated queries. If not provided, 0 will be applied. The 0 value means the query isolation functionality will be disabled.", - }, - "max_nodes_per_query": schema.Int64Attribute{ - Optional: true, - MarkdownDescription: "Maximum number of nodes per isolated query. If not provided, 0 will be applied. The 0 value means the query isolation functionality will be disabled.", - }, - }, - }, "last_updated": schema.StringAttribute{ Computed: true, MarkdownDescription: "Timestamp of the last Terraform update of the order.",