Skip to content

Commit

Permalink
Merge pull request #7108 from ministryofjustice/performance-hub/dev-rds
Browse files Browse the repository at this point in the history
Performance Hub - create dev RDS
  • Loading branch information
jemnery authored Jul 18, 2024
2 parents 8c5e63f + fb98479 commit 2a5779c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"container_memory": "3072",
"task_definition_volume": "upload_volume",
"network_mode": "none",
"db_enabled": false,
"db_enabled": true,
"db_instance_class": "db.m5.large",
"db_user": "admin",
"db_allocated_storage": "100",
Expand Down
7 changes: 5 additions & 2 deletions terraform/environments/performance-hub/database.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resource "aws_db_instance" "database" {
storage_encrypted = true
iam_database_authentication_enabled = false
vpc_security_group_ids = [aws_security_group.db.id]
snapshot_identifier = format("arn:aws:rds:eu-west-2:%s:snapshot:%s", data.aws_caller_identity.current.account_id, local.app_data.accounts[local.environment].db_snapshot_identifier)
#snapshot_identifier = format("arn:aws:rds:eu-west-2:%s:snapshot:%s", data.aws_caller_identity.current.account_id, local.app_data.accounts[local.environment].db_snapshot_identifier)
backup_retention_period = 30
maintenance_window = "Mon:00:00-Mon:03:00"
backup_window = "03:00-06:00"
Expand All @@ -31,7 +31,10 @@ resource "aws_db_instance" "database" {
db_subnet_group_name = aws_db_subnet_group.db.id
enabled_cloudwatch_logs_exports = ["error"]
ca_cert_identifier = "rds-ca-rsa2048-g1"
apply_immediately = true
# BE VERY CAREFUL with apply_immediately = true. Useful if you want to see the results, but can cause a reboot
# of RDS meaning the connected app will fail.
# When apply_immediately=false, RDS changes are applied during the next maintenance_window
apply_immediately = false

# timeouts {
# create = "40m"
Expand Down

0 comments on commit 2a5779c

Please sign in to comment.