Skip to content

Commit

Permalink
Merge pull request #3774 from ministryofjustice/CC-2154/EBS-DB-volumes
Browse files Browse the repository at this point in the history
CC-2154: New volumes for EBS DB.
  • Loading branch information
mmgovuk authored Nov 6, 2023
2 parents 8ba6000 + 1cbdac6 commit 7cdea78
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
12 changes: 12 additions & 0 deletions terraform/environments/ccms-ebs/application_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
"ebs_size_ebsdb_u01": 300,
"ebs_size_ebsdb_arch": 500,
"ebs_size_ebsdb_dbf": 11000,
"ebs_size_ebsdb_dbf01": 4000,
"ebs_size_ebsdb_dbf02": 4000,
"ebs_size_ebsdb_dbf03": 3000,
"ebs_size_ebsdb_dbf_dr": 8000,
"ebs_size_ebsdb_redoA": 100,
"ebs_size_ebsdb_redoB": 50,
Expand Down Expand Up @@ -147,6 +150,9 @@
"ebs_size_ebsdb_u01": 300,
"ebs_size_ebsdb_arch": 500,
"ebs_size_ebsdb_dbf": 11000,
"ebs_size_ebsdb_dbf01": 4000,
"ebs_size_ebsdb_dbf02": 4000,
"ebs_size_ebsdb_dbf03": 3000,
"ebs_size_ebsdb_redoA": 100,
"ebs_size_ebsdb_redoB": 50,
"ebs_size_ebsdb_techst": 50,
Expand Down Expand Up @@ -223,6 +229,9 @@
"ebs_size_ebsdb_u01": 300,
"ebs_size_ebsdb_arch": 500,
"ebs_size_ebsdb_dbf": 11000,
"ebs_size_ebsdb_dbf01": 4000,
"ebs_size_ebsdb_dbf02": 4000,
"ebs_size_ebsdb_dbf03": 3000,
"ebs_size_ebsdb_redoA": 100,
"ebs_size_ebsdb_redoB": 50,
"ebs_size_ebsdb_techst": 50,
Expand Down Expand Up @@ -299,6 +308,9 @@
"ebs_size_ebsdb_u01": 300,
"ebs_size_ebsdb_arch": 500,
"ebs_size_ebsdb_dbf": 11000,
"ebs_size_ebsdb_dbf01": 4000,
"ebs_size_ebsdb_dbf02": 4000,
"ebs_size_ebsdb_dbf03": 3000,
"ebs_size_ebsdb_redoA": 100,
"ebs_size_ebsdb_redoB": 50,
"ebs_size_ebsdb_techst": 50,
Expand Down
81 changes: 81 additions & 0 deletions terraform/environments/ccms-ebs/ccms-ec2-oracle_ebs_db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,87 @@ resource "aws_volume_attachment" "diag_att" {
volume_id = aws_ebs_volume.diag.id
instance_id = aws_instance.ec2_oracle_ebs.id
}

resource "aws_ebs_volume" "dbf01" {
count = local.is-development ? 1 : 0
lifecycle {
ignore_changes = [kms_key_id]
}
availability_zone = "eu-west-2a"
size = local.application_data.accounts[local.environment].ebs_size_ebsdb_dbf01
type = "io2"
iops = 12000
encrypted = true
kms_key_id = data.aws_kms_key.ebs_shared.key_id
tags = merge(local.tags,
{ Name = "dbf01" }
)
}

resource "aws_volume_attachment" "dbf01_att" {
count = local.is-development ? 1 : 0
depends_on = [
aws_ebs_volume.dbf01
]
device_name = "/dev/sdq"
volume_id = aws_ebs_volume.dbf01[0].id
instance_id = aws_instance.ec2_oracle_ebs.id
}


resource "aws_ebs_volume" "dbf02" {
count = local.is-development ? 1 : 0
lifecycle {
ignore_changes = [kms_key_id]
}
availability_zone = "eu-west-2a"
size = local.application_data.accounts[local.environment].ebs_size_ebsdb_dbf02
type = "io2"
iops = 12000
encrypted = true
kms_key_id = data.aws_kms_key.ebs_shared.key_id
tags = merge(local.tags,
{ Name = "dbf02" }
)
}

resource "aws_volume_attachment" "dbf02_att" {
count = local.is-development ? 1 : 0
depends_on = [
aws_ebs_volume.dbf02
]
device_name = "/dev/sdr"
volume_id = aws_ebs_volume.dbf02[0].id
instance_id = aws_instance.ec2_oracle_ebs.id
}


resource "aws_ebs_volume" "dbf03" {
count = local.is-development ? 1 : 0
lifecycle {
ignore_changes = [kms_key_id]
}
availability_zone = "eu-west-2a"
size = local.application_data.accounts[local.environment].ebs_size_ebsdb_dbf03
type = "io2"
iops = 12000
encrypted = true
kms_key_id = data.aws_kms_key.ebs_shared.key_id
tags = merge(local.tags,
{ Name = "dbf03" }
)
}

resource "aws_volume_attachment" "dbf03_att" {
count = local.is-development ? 1 : 0
depends_on = [
aws_ebs_volume.dbf03
]
device_name = "/dev/sds"
volume_id = aws_ebs_volume.dbf03[0].id
instance_id = aws_instance.ec2_oracle_ebs.id
}

/*
#### This mount was required for golive incident
#### Just commenting out, rather than remove - just in case
Expand Down

0 comments on commit 7cdea78

Please sign in to comment.