1 Answer
- Newest
- Most votes
- Most comments
0
Hello.
For Aurora Serverless V2, you do not specify serverless in "engine_mode".
Specify serverless in the "instance_class" of the instances in the cluster.
The following documents provide examples:
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster
To create a Serverless v2 RDS cluster, you must additionally specify the engine_mode and serverlessv2_scaling_configuration attributes. An aws_rds_cluster_instance resource must also be added to the cluster with the instance_class attribute specified.
resource "aws_rds_cluster" "example" {
cluster_identifier = "example"
engine = "aurora-postgresql"
engine_mode = "provisioned"
engine_version = "16.6"
database_name = "test"
master_username = "test"
master_password = "must_be_eight_characters"
storage_encrypted = true
serverlessv2_scaling_configuration {
max_capacity = 1.0
min_capacity = 0.0
seconds_until_auto_pause = 3600
}
}
resource "aws_rds_cluster_instance" "example" {
cluster_identifier = aws_rds_cluster.example.id
instance_class = "db.serverless"
engine = aws_rds_cluster.example.engine
engine_version = aws_rds_cluster.example.engine_version
}
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 9 months ago
