Skip to content

Commit 42e1335

Browse files
authored
Upgrade DB version for QA and Test (#3446)
* Update QA and Test to use the latest available DB engine version, 16.8. * The upgrade will be applied during the next maintenance window * Also change maintenance window for sooner execution
2 parents d4a1ba4 + 57c8e13 commit 42e1335

4 files changed

Lines changed: 34 additions & 14 deletions

File tree

terraform/app/env/qa.tfvars

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ http_hosts = {
2525
appspec_bucket = "nhse-mavis-appspec-bucket-qa"
2626
minimum_web_replicas = 2
2727
maximum_web_replicas = 4
28+
29+
rds_engine_version = "16.8"
30+
rds_maintenance_window = "tue:02:30-tue:03:00"

terraform/app/env/test.tfvars

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ http_hosts = {
2020
MAVIS__GIVE_OR_REFUSE_CONSENT_HOST = "test.mavistesting.com"
2121
}
2222
appspec_bucket = "nhse-mavis-appspec-bucket-test"
23+
24+
rds_engine_version = "16.8"
25+
rds_maintenance_window = "tue:02:30-tue:03:00"

terraform/app/rds.tf

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,21 @@ resource "aws_db_subnet_group" "aurora_subnet_group" {
3434
}
3535

3636
resource "aws_rds_cluster" "aurora_cluster" {
37-
cluster_identifier = var.resource_name.db_cluster
38-
engine = "aurora-postgresql"
39-
engine_mode = "provisioned"
40-
engine_version = "14.9"
41-
database_name = "manage_vaccinations"
42-
master_username = "postgres"
43-
manage_master_user_password = var.db_secret_arn == null
44-
storage_encrypted = true
45-
backup_retention_period = var.backup_retention_period
46-
skip_final_snapshot = !local.is_production
47-
db_subnet_group_name = aws_db_subnet_group.aurora_subnet_group.name
48-
vpc_security_group_ids = [aws_security_group.rds_security_group.id]
49-
deletion_protection = true
37+
cluster_identifier = var.resource_name.db_cluster
38+
engine = "aurora-postgresql"
39+
engine_mode = "provisioned"
40+
engine_version = var.rds_engine_version
41+
database_name = "manage_vaccinations"
42+
master_username = "postgres"
43+
manage_master_user_password = var.db_secret_arn == null
44+
storage_encrypted = true
45+
backup_retention_period = var.backup_retention_period
46+
skip_final_snapshot = !local.is_production
47+
db_subnet_group_name = aws_db_subnet_group.aurora_subnet_group.name
48+
vpc_security_group_ids = [aws_security_group.rds_security_group.id]
49+
deletion_protection = true
50+
allow_major_version_upgrade = true
51+
preferred_maintenance_window = var.rds_maintenance_window
5052

5153
serverlessv2_scaling_configuration {
5254
max_capacity = var.max_aurora_capacity_units

terraform/app/variables.tf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,19 @@ variable "backup_retention_period" {
229229
description = "The number of days to retain backups for the RDS cluster."
230230
}
231231

232-
########## ESC/Scaling Configuration ##########
232+
variable "rds_engine_version" {
233+
type = string
234+
default = "14.9"
235+
description = "The version of the database engine to use for the RDS cluster."
236+
}
237+
238+
variable "rds_maintenance_window" {
239+
type = string
240+
default = "sun:02:30-sun:03:00"
241+
description = "The preferred maintenance window for the RDS cluster."
242+
}
243+
244+
########## ECS/Scaling Configuration ##########
233245

234246
variable "minimum_web_replicas" {
235247
type = number

0 commit comments

Comments
 (0)