diff --git a/terraform/environments/ccms-ebs-upgrade/application_variables.json b/terraform/environments/ccms-ebs-upgrade/application_variables.json index a8aa8b2810d..3f1bd36de50 100644 --- a/terraform/environments/ccms-ebs-upgrade/application_variables.json +++ b/terraform/environments/ccms-ebs-upgrade/application_variables.json @@ -89,6 +89,8 @@ "ebs_size_ebsdb_dbf02": 4000, "ebs_iops_ebsdb_dbf03": 12000, "ebs_size_ebsdb_dbf03": 3000, + "ebs_iops_ebsdb_dbf04": 3000, + "ebs_size_ebsdb_dbf04": 500, "ebs_size_ebsdb_redoA": 100, "ebs_size_ebsdb_redoB": 50, "ebs_size_ebsdb_techst": 100, @@ -98,9 +100,15 @@ "ebs_default_iops_test": 9000, "dbf_device": "nvme5n1", "dbf_path": "/CCMS/EBS/dbf", - "dbf01_snapshot_id": "", - "dbf02_snapshot_id": "", - "dbf03_snapshot_id": "", + "arch_snapshot_id": "snap-06ac9e476306a81f0", + "dbf01_snapshot_id": "snap-052d0aa1b0738b7e8", + "dbf02_snapshot_id": "snap-09f49790bedbce8b9", + "dbf03_snapshot_id": "snap-01d845525a4adb282", + "dbf04_snapshot_id": "snap-037d6f4929f4b7b45", + "redoa_snapshot_id": "snap-0cd7653ebb34fb4d0", + "redob_snapshot_id": "snap-04ef7473cd3b08835", + "techst_snapshot_id": "snap-070ac6c02623d7820", + "home_snapshot_id": "snap-0b3ed6004c1adabc7", "ebs_type_ebsdb_backup": "gp3", "ebs_size_ebsconc_exhome": 100, "ebs_size_ebsconc_u01": 200, @@ -204,6 +212,8 @@ "ebs_size_ebsdb_dbf02": 4000, "ebs_iops_ebsdb_dbf03": 12000, "ebs_size_ebsdb_dbf03": 3000, + "ebs_iops_ebsdb_dbf04": 3000, + "ebs_size_ebsdb_dbf04": 500, "ebs_size_ebsdb_redoA": 100, "ebs_size_ebsdb_redoB": 50, "ebs_size_ebsdb_techst": 100, @@ -213,9 +223,15 @@ "ebs_default_iops_test": 9000, "dbf_device": "nvme5n1", "dbf_path": "/CCMS/EBS/dbf", + "arch_snapshot_id": "", "dbf01_snapshot_id": "snap-04ab84f4b1c4bc04e", "dbf02_snapshot_id": "snap-01e6b7d595e24bea4", "dbf03_snapshot_id": "snap-0dcd7f2e82fc77739", + "dbf04_snapshot_id": "", + "redoa_snapshot_id": "", + "redob_snapshot_id": "", + "techst_snapshot_id": "", + "home_snapshot_id": "", "ebs_type_ebsdb_backup": "gp3", "ebs_size_ebsconc_exhome": 100, "ebs_size_ebsconc_u01": 200, 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 646416f3a65..f9724ca1c5d 100644 --- a/terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf +++ b/terraform/environments/ccms-ebs-upgrade/ec2-oracle_ebs_db.tf @@ -121,6 +121,7 @@ resource "aws_ebs_volume" "arch" { ignore_changes = [kms_key_id] } availability_zone = "eu-west-2a" + snapshot_id = length(local.application_data.accounts[local.environment].arch_snapshot_id) > 0 ? local.application_data.accounts[local.environment].arch_snapshot_id : null size = local.application_data.accounts[local.environment].ebs_size_ebsdb_arch type = "io2" iops = 3000 @@ -238,11 +239,38 @@ resource "aws_volume_attachment" "dbf03_att" { instance_id = aws_instance.ec2_oracle_ebs.id } +resource "aws_ebs_volume" "dbf04" { + lifecycle { + ignore_changes = [kms_key_id] + } + availability_zone = "eu-west-2a" + snapshot_id = length(local.application_data.accounts[local.environment].dbf04_snapshot_id) > 0 ? local.application_data.accounts[local.environment].dbf04_snapshot_id : null + size = local.application_data.accounts[local.environment].ebs_size_ebsdb_dbf04 + type = "io2" + iops = local.application_data.accounts[local.environment].ebs_iops_ebsdb_dbf04 + encrypted = true + kms_key_id = data.aws_kms_key.ebs_shared.key_id + tags = merge(local.tags, + { Name = lower(format("%s-%s", local.application_data.accounts[local.environment].instance_role_ebsdb, "dbf04")) }, + { device-name = "/dev/sdt" } + ) +} + +resource "aws_volume_attachment" "dbf04_att" { + depends_on = [ + aws_ebs_volume.dbf04 + ] + device_name = "/dev/sdt" + volume_id = aws_ebs_volume.dbf04.id + instance_id = aws_instance.ec2_oracle_ebs.id +} + resource "aws_ebs_volume" "redoA" { lifecycle { ignore_changes = [kms_key_id] } availability_zone = "eu-west-2a" + snapshot_id = length(local.application_data.accounts[local.environment].redoa_snapshot_id) > 0 ? local.application_data.accounts[local.environment].redoa_snapshot_id : null size = local.application_data.accounts[local.environment].ebs_size_ebsdb_redoA type = "io2" iops = 3000 @@ -265,6 +293,7 @@ resource "aws_ebs_volume" "techst" { ignore_changes = [kms_key_id] } availability_zone = "eu-west-2a" + snapshot_id = length(local.application_data.accounts[local.environment].techst_snapshot_id) > 0 ? local.application_data.accounts[local.environment].techst_snapshot_id : null size = local.application_data.accounts[local.environment].ebs_size_ebsdb_techst type = "io2" iops = 3000 @@ -310,6 +339,7 @@ resource "aws_ebs_volume" "redoB" { ignore_changes = [kms_key_id] } availability_zone = "eu-west-2a" + snapshot_id = length(local.application_data.accounts[local.environment].redob_snapshot_id) > 0 ? local.application_data.accounts[local.environment].redob_snapshot_id : null size = local.application_data.accounts[local.environment].ebs_size_ebsdb_redoB type = "io2" iops = 3000 @@ -386,13 +416,14 @@ resource "aws_ebs_volume" "db_home" { ignore_changes = [kms_key_id] } availability_zone = "eu-west-2a" + snapshot_id = length(local.application_data.accounts[local.environment].home_snapshot_id) > 0 ? local.application_data.accounts[local.environment].home_snapshot_id : null size = local.application_data.accounts[local.environment].ebs_size_ebsdb_home type = "io2" iops = 3000 encrypted = true kms_key_id = data.aws_kms_key.ebs_shared.key_id tags = merge(local.tags, - { Name = lower(format("%s-%s", local.application_data.accounts[local.environment].instance_role_ebsdb, "db-home")) }, + { Name = lower(format("%s-%s", local.application_data.accounts[local.environment].instance_role_ebsdb, "home")) }, { device-name = "/dev/sdr" } ) } @@ -414,7 +445,7 @@ resource "aws_ebs_volume" "db_temp" { encrypted = true kms_key_id = data.aws_kms_key.ebs_shared.key_id tags = merge(local.tags, - { Name = lower(format("%s-%s", local.application_data.accounts[local.environment].instance_role_ebsdb, "db-temp")) }, + { Name = lower(format("%s-%s", local.application_data.accounts[local.environment].instance_role_ebsdb, "temp")) }, { device-name = "/dev/sds" } ) }