Skip to content

Commit

Permalink
Merge pull request #4259 from ministryofjustice/CC-2254/EBS-DB-swap
Browse files Browse the repository at this point in the history
CC-2254: Added a swap volume to EBS DB in the Upgrade environment.
  • Loading branch information
mmgovuk authored Dec 7, 2023
2 parents 171e142 + d6ac28f commit af70cb6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"ebsapps_u03_size": 200,
"ebsapps_stage_size": 100,
"tg_apps_port": 8000,
"ebs_iops_ebsdb_swap": 3000,
"ebs_size_ebsdb_swap": 20,
"ebs_size_ebsdb_home": 100,
"ebs_size_ebsdb_temp": 100,
"ebs_size_ebsdb_exhome": 100,
Expand Down
24 changes: 24 additions & 0 deletions terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,30 @@ resource "aws_instance" "ec2_oracle_ebs" {
depends_on = [aws_security_group.ec2_sg_ebsdb]
}

resource "aws_ebs_volume" "ebsdb_swap" {
lifecycle {
ignore_changes = [kms_key_id]
}
availability_zone = "eu-west-2a"
size = local.application_data.accounts[local.environment].ebs_size_ebsdb_swap
type = "gp3"
iops = local.application_data.accounts[local.environment].ebs_iops_ebsdb_swap
encrypted = true
kms_key_id = data.aws_kms_key.ebs_shared.key_id
tags = merge(local.tags,
{ Name = "swap" }
)
}

resource "aws_volume_attachment" "ebsdb_swap_att" {
depends_on = [
aws_ebs_volume.ebsdb_swap
]
device_name = "/dev/sdb"
volume_id = aws_ebs_volume.ebsdb_swap.id
instance_id = aws_instance.ec2_oracle_ebs.id
}

resource "aws_ebs_volume" "export_home" {
lifecycle {
ignore_changes = [kms_key_id]
Expand Down

0 comments on commit af70cb6

Please sign in to comment.