Skip to content

Commit

Permalink
Merge pull request #7096 from ministryofjustice/LAWS-3953
Browse files Browse the repository at this point in the history
LAWS-3953 - transfer ebs volumes
  • Loading branch information
ffteva-moj authored Jul 15, 2024
2 parents 9aa302c + d0d57ac commit 7256bf4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
12 changes: 9 additions & 3 deletions terraform/environments/edw/application_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"edw_AppName": "EDW2",
"edw_environment": "dev",
"edw_region": "eu-west-2",
"edw_ec2_ami_id": "ami-01d4d23fbf3fcc925",
"edw_ec2_ami_id": "ami-093381ebab6476c17",
"edw_ec2_instance_type": "m4.xlarge",
"edw_ssh_key_name": "development-general",
"edw_OrahomeVolumeSize": "150",
Expand Down Expand Up @@ -59,8 +59,14 @@
"edw_disk_device": "/dev/xvdf",
"edw_disk_fs_type": "ext4",
"database_ec2_name": "edw-db-instance",
"edw_ec2_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCqJXcEXymhifpt3jSnLHVoPCwD07usEGhKCboMjMuSS2nFaSy+JDhsL/BKUQUgW88ozLzCp4XL0+jfpqzJqwrgVgfZI059w6QqLXyUF8HxQa0jolOWQZXq9+BZX6DnmPX84p40MZ38OrNiEoNuSqN1u3dqbRIageDSJuKAp39DjrQVoTPh1lchddKiucVMU0xK8Z1QQWHyoZTBYolC+hPNZ7lwT+Vq8CLywDUlBcZdbCKRMeUXD+kzg+nduCyB71gV4zlE4vD7x/RADvAfOINVQNSRQFY9QgnQylyylsRhzCGtXTPUC6Cnhmi49L/AyDd7Qh78ZEOOrs5HTJNsJmt84LuurD9dimtour2tlvDkZOurib/voKfrHxih1q5lgzn7BEZ42jO0H6UKtHv9hkkMOCfewnGHrkZ9ptgmHyR/pMWXbwiM/+osc1XLgEBJ6rFe+mtge4GzIx5ZApMGZV3LFe3ZoPGtnyORvjyI/jkOTco6gVIc87Wn0MkD5tFV9ME= fani.foteva@MJ004598",
"edw_pagerduty_integration_key_name": "laa_edw_nonprod_alarms"
"edw_ec2_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCTLaLYlRp9nXnprXkvSd9pxHxJq4KrZENz0PQ4fy8xe93x54TRfqzMEJdG4tl9Yb5Uv0HEmvi9kMSKZ8uorM67v9oFI5/xtnFoxO9M/cDLXbUmIQ5QFP6+BlDAPWPTV8hh9jAhY1VhkFJTGF0vMBCxdqfIwKH4l6wTciP/lrPYqp4uKddicg0T9mfk6y1EvaZhVTgpMdtj374xC+t57JN6TEuYxwcxsdUA4tB9y4B51LE9WEG7w1up8SeTduCAyGNpUu0lKVnLgpkcrJ3hD/pavUzdAmFESYmMjJkvtKHIuEaAVlxaWQDhHFAJ0BdMlJV4jAARaqgtqgLpsjp3NPnM4FOu3wXRY6+gw3cwDyg7TFlwksnayCHG3ZrSs3fF2cVGF/VQ9L0QZyayPNxnh1g+B7Nnuly3eXLOwD0KQ8XtNDvAX0kV7e2QGiDO0//n+LQHqDMFMTvVWo5g2Ct2HjP97Wf+QgYZ2wbAxb/JSnlHMxbrjeAo0DejscoYzp9f3AM= fani.foteva@MJ004598",
"edw_pagerduty_integration_key_name": "laa_edw_nonprod_alarms",
"oradata_snapshot_id": "snap-08e331d215e456fec",
"orahome_snapshot_id": "snap-076f7b759f1cbfa2b",
"oraarch_snapshot_id": "snap-00dbc56ab1d6c9930",
"software_snapshot_id": "snap-01e51c08b7e397fdc",
"oraredo_snapshot_id": "snap-0936e759e58c09af9"

},
"test": {
"example_var": "test-data"
Expand Down
12 changes: 11 additions & 1 deletion terraform/environments/edw/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ resource "aws_iam_instance_profile" "edw_ec2_instance_profile" {
####### DB Instance #######

resource "aws_key_pair" "edw_ec2_key" {
key_name = "${local.application_name}-ssh-key"
key_name = "${local.application_name}-ssh-key-new"
public_key = local.application_data.accounts[local.environment].edw_ec2_key
}

Expand Down Expand Up @@ -134,6 +134,8 @@ resource "aws_ebs_volume" "orahomeVolume" {
size = local.application_data.accounts[local.environment].edw_OrahomeVolumeSize
encrypted = true
type = "gp3"
kms_key_id = data.aws_kms_key.ebs_shared.key_id
snapshot_id = local.application_data.accounts[local.environment].orahome_snapshot_id # This is used for when data is being migrated

tags = {
Name = "${local.application_data.accounts[local.environment].edw_AppName}-orahome"
Expand All @@ -151,6 +153,8 @@ resource "aws_ebs_volume" "oratempVolume" {
size = local.application_data.accounts[local.environment].edw_OratempVolumeSize
encrypted = true
type = "gp3"
kms_key_id = data.aws_kms_key.ebs_shared.key_id
snapshot_id = local.application_data.accounts[local.environment].oraredo_snapshot_id # This is used for when data is being migrated

tags = {
Name = "${local.application_data.accounts[local.environment].edw_AppName}-oraredo"
Expand All @@ -168,6 +172,8 @@ resource "aws_ebs_volume" "oradataVolume" {
size = local.application_data.accounts[local.environment].edw_OradataVolumeSize
encrypted = true
type = "gp3"
kms_key_id = data.aws_kms_key.ebs_shared.key_id
snapshot_id = local.application_data.accounts[local.environment].oradata_snapshot_id # This is used for when data is being migrated

tags = {
Name = "${local.application_data.accounts[local.environment].edw_AppName}-oradata"
Expand All @@ -185,6 +191,8 @@ resource "aws_ebs_volume" "softwareVolume" {
size = local.application_data.accounts[local.environment].edw_SoftwareVolumeSize
encrypted = true
type = "gp3"
kms_key_id = data.aws_kms_key.ebs_shared.key_id
snapshot_id = local.application_data.accounts[local.environment].software_snapshot_id # This is used for when data is being migrated

tags = {
Name = "${local.application_data.accounts[local.environment].edw_AppName}-software"
Expand All @@ -202,6 +210,8 @@ resource "aws_ebs_volume" "ArchiveVolume" {
size = local.application_data.accounts[local.environment].edw_ArchiveVolumeSize
encrypted = true
type = "gp3"
kms_key_id = data.aws_kms_key.ebs_shared.key_id
snapshot_id = local.application_data.accounts[local.environment].oraarch_snapshot_id # This is used for when data is being migrated

tags = {
Name = "${local.application_data.accounts[local.environment].edw_AppName}-oraarch"
Expand Down

0 comments on commit 7256bf4

Please sign in to comment.