Skip to content

Commit 94bab2b

Browse files
chore: Migrate Terraform AWS RDS Aurora module from v9 to v10 (#231)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: DerekRoberts <[email protected]>
1 parent bfc4a11 commit 94bab2b

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

infra/modules/database/main.tf

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ data "aws_rds_engine_version" "postgresql" {
1313
# -------------------------
1414
module "aurora_postgresql_v2" {
1515
source = "terraform-aws-modules/rds-aurora/aws"
16-
version = "9.16.1"
16+
version = "10.0.0"
1717
allow_major_version_upgrade = true
1818
name = var.db_cluster_name
1919
engine = data.aws_rds_engine_version.postgresql.engine
@@ -27,28 +27,36 @@ module "aurora_postgresql_v2" {
2727
db_subnet_group_name = aws_db_subnet_group.db_subnet_group.name
2828

2929
master_username = var.db_master_username
30-
master_password = random_password.db_master_password.result
30+
master_password_wo = random_password.db_master_password.result
31+
master_password_wo_version = 1
3132
manage_master_user_password = false
3233

3334
create_security_group = false
3435
create_db_subnet_group = false
3536
create_monitoring_role = false
3637

37-
apply_immediately = true
38-
skip_final_snapshot = true
39-
auto_minor_version_upgrade = true
38+
apply_immediately = true
39+
skip_final_snapshot = true
4040

4141
deletion_protection = contains(["prod"], var.app_env) ? true : false
4242
serverlessv2_scaling_configuration = {
4343
min_capacity = var.min_capacity
4444
max_capacity = var.max_capacity
4545
}
4646

47-
instance_class = "db.serverless"
47+
cluster_instance_class = "db.serverless"
4848
instances = var.ha_enabled ? {
49-
one = {}
50-
two = {}
51-
} : { one = {} }
49+
one = {
50+
auto_minor_version_upgrade = true
51+
}
52+
two = {
53+
auto_minor_version_upgrade = true
54+
}
55+
} : {
56+
one = {
57+
auto_minor_version_upgrade = true
58+
}
59+
}
5260

5361
tags = module.common.common_tags
5462

0 commit comments

Comments
 (0)