diff --git a/.changelog/40230.txt b/.changelog/40230.txt new file mode 100644 index 00000000000..aa859323802 --- /dev/null +++ b/.changelog/40230.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_rds_cluster: Adjust `serverlessv2_scaling_configuration.max_capacity` and `serverlessv2_scaling_configuration.min_capacity` minimum values to `0` to support Amazon Aurora Serverless v2 scaling to 0 ACUs +``` \ No newline at end of file diff --git a/internal/service/rds/cluster.go b/internal/service/rds/cluster.go index 91e19ef8853..050293fdc36 100644 --- a/internal/service/rds/cluster.go +++ b/internal/service/rds/cluster.go @@ -547,12 +547,12 @@ func resourceCluster() *schema.Resource { names.AttrMaxCapacity: { Type: schema.TypeFloat, Required: true, - ValidateFunc: validation.FloatBetween(0.5, 256), + ValidateFunc: validation.FloatBetween(0, 256), }, "min_capacity": { Type: schema.TypeFloat, Required: true, - ValidateFunc: validation.FloatBetween(0.5, 256), + ValidateFunc: validation.FloatBetween(0, 256), }, }, }, @@ -2136,11 +2136,11 @@ func expandServerlessV2ScalingConfiguration(tfMap map[string]interface{}) *types apiObject := &types.ServerlessV2ScalingConfiguration{} - if v, ok := tfMap[names.AttrMaxCapacity].(float64); ok && v != 0.0 { + if v, ok := tfMap[names.AttrMaxCapacity].(float64); ok { apiObject.MaxCapacity = aws.Float64(v) } - if v, ok := tfMap["min_capacity"].(float64); ok && v != 0.0 { + if v, ok := tfMap["min_capacity"].(float64); ok { apiObject.MinCapacity = aws.Float64(v) } diff --git a/internal/service/rds/cluster_test.go b/internal/service/rds/cluster_test.go index cece7570cbb..9804d6cd76f 100644 --- a/internal/service/rds/cluster_test.go +++ b/internal/service/rds/cluster_test.go @@ -2068,21 +2068,21 @@ func TestAccRDSCluster_serverlessV2ScalingConfiguration(t *testing.T) { CheckDestroy: testAccCheckClusterDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccClusterConfig_serverlessV2ScalingConfiguration(rName, 64.0, 0.5), + Config: testAccClusterConfig_serverlessV2ScalingConfiguration(rName, 64.0, 2.5), Check: resource.ComposeTestCheckFunc( testAccCheckClusterExists(ctx, resourceName, &dbCluster), resource.TestCheckResourceAttr(resourceName, "serverlessv2_scaling_configuration.#", "1"), resource.TestCheckResourceAttr(resourceName, "serverlessv2_scaling_configuration.0.max_capacity", "64"), - resource.TestCheckResourceAttr(resourceName, "serverlessv2_scaling_configuration.0.min_capacity", "0.5"), + resource.TestCheckResourceAttr(resourceName, "serverlessv2_scaling_configuration.0.min_capacity", "2.5"), ), }, { - Config: testAccClusterConfig_serverlessV2ScalingConfiguration(rName, 256.0, 8.5), + Config: testAccClusterConfig_serverlessV2ScalingConfiguration(rName, 256.0, 0), Check: resource.ComposeTestCheckFunc( testAccCheckClusterExists(ctx, resourceName, &dbCluster), resource.TestCheckResourceAttr(resourceName, "serverlessv2_scaling_configuration.#", "1"), resource.TestCheckResourceAttr(resourceName, "serverlessv2_scaling_configuration.0.max_capacity", "256"), - resource.TestCheckResourceAttr(resourceName, "serverlessv2_scaling_configuration.0.min_capacity", "8.5"), + resource.TestCheckResourceAttr(resourceName, "serverlessv2_scaling_configuration.0.min_capacity", "0"), ), }, }, diff --git a/website/docs/r/rds_cluster.html.markdown b/website/docs/r/rds_cluster.html.markdown index fb0a8dfa083..de42df3e3a3 100644 --- a/website/docs/r/rds_cluster.html.markdown +++ b/website/docs/r/rds_cluster.html.markdown @@ -366,8 +366,8 @@ resource "aws_rds_cluster" "example" { } ``` -* `max_capacity` - (Required) Maximum capacity for an Aurora DB cluster in `provisioned` DB engine mode. The maximum capacity must be greater than or equal to the minimum capacity. Valid capacity values are in a range of `0.5` up to `256` in steps of `0.5`. -* `min_capacity` - (Required) Minimum capacity for an Aurora DB cluster in `provisioned` DB engine mode. The minimum capacity must be lesser than or equal to the maximum capacity. Valid capacity values are in a range of `0.5` up to `256` in steps of `0.5`. +* `max_capacity` - (Required) Maximum capacity for an Aurora DB cluster in `provisioned` DB engine mode. The maximum capacity must be greater than or equal to the minimum capacity. Valid capacity values are in a range of `0` up to `256` in steps of `0.5`. +* `min_capacity` - (Required) Minimum capacity for an Aurora DB cluster in `provisioned` DB engine mode. The minimum capacity must be lesser than or equal to the maximum capacity. Valid capacity values are in a range of `0` up to `256` in steps of `0.5`. ## Attribute Reference