From b869b576e8b042ce081ec74ef7a3425efa451488 Mon Sep 17 00:00:00 2001 From: Maciej Matysiak <103054339+mmgovuk@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:10:39 +0000 Subject: [PATCH 1/2] CC-2254: Added a swap volume to EBS DB in the Upgrade environment. --- .../application_variables.json | 2 ++ .../ccms-ebs-upgrade/ec2-oracle_ebs_db.tf | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/terraform/environments/ccms-ebs-upgrade/application_variables.json b/terraform/environments/ccms-ebs-upgrade/application_variables.json index 5af8d80a4da..3fafe74446c 100644 --- a/terraform/environments/ccms-ebs-upgrade/application_variables.json +++ b/terraform/environments/ccms-ebs-upgrade/application_variables.json @@ -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, diff --git a/terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf b/terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf index ccae9815612..10bab522b12 100644 --- a/terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf +++ b/terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf @@ -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.swap + ] + device_name = "/dev/sdb" + volume_id = aws_ebs_volume.swap.id + instance_id = aws_instance.ec2_oracle_ebs.id +} + resource "aws_ebs_volume" "export_home" { lifecycle { ignore_changes = [kms_key_id] From d6ac28f7854af32654954ec54fdeca992761be58 Mon Sep 17 00:00:00 2001 From: Maciej Matysiak <103054339+mmgovuk@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:15:22 +0000 Subject: [PATCH 2/2] CC-2254: Fixed typos. --- terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf b/terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf index 10bab522b12..e0bfa431aad 100644 --- a/terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf +++ b/terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf @@ -63,10 +63,10 @@ resource "aws_ebs_volume" "ebsdb_swap" { resource "aws_volume_attachment" "ebsdb_swap_att" { depends_on = [ - aws_ebs_volume.swap + aws_ebs_volume.ebsdb_swap ] device_name = "/dev/sdb" - volume_id = aws_ebs_volume.swap.id + volume_id = aws_ebs_volume.ebsdb_swap.id instance_id = aws_instance.ec2_oracle_ebs.id }