Skip to content

Commit

Permalink
Merge pull request #3115 from ministryofjustice/CC-2020
Browse files Browse the repository at this point in the history
CC-2020: Re-design of use of AMIs
  • Loading branch information
SahidKhan89 authored Aug 17, 2023
2 parents d16f610 + c07395b commit b464bfe
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
28 changes: 28 additions & 0 deletions terraform/environments/ccms-ebs/application_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
"ftp_ami_id": "ami-0d8e665f120c20253",
"ec2_instance_type_clamav": "c5d.large",
"clamav_ami_id": "ami-0965b5afb3ac7174e",
"ebsdb_ami_id": "ami-0df5f31cae1c86635",
"ebsapps_ami_id-1": "ami-0d4b266f7ae87bbfc",
"ebsapps_ami_id-2": "ami-0d4b266f7ae87bbfc",
"accessgate_ami_id-1": "ami-0695726199c3e30e5",
"accessgate_ami_id-2": "ami-0695726199c3e30e5",
"webgate_ami_id-1": "ami-0e398cd57c81356a7",
"webgate_ami_id-2": "ami-0e398cd57c81356a7",
"restored_db_image": "ami-0df5f31cae1c86635",
"orace_base_prereqs_ami_name": "Oracle79-prereqs-v2_0",
"orace_db_ami_name": "Oracle79-prereqs-v1_8",
Expand Down Expand Up @@ -93,6 +100,13 @@
"ftp_ami_id": "ami-08cd358d745620807",
"ec2_instance_type_clamav": "c5d.large",
"clamav_ami_id": "ami-03e88be9ecff64781",
"ebsdb_ami_id": "ami-00f388bac07735df0",
"ebsapps_ami_id-1": "ami-00f388bac07735df0",
"ebsapps_ami_id-2": "ami-00f388bac07735df0",
"accessgate_ami_id-1": "ami-0032b20a53f433208",
"accessgate_ami_id-2": "ami-0032b20a53f433208",
"webgate_ami_id-1": "ami-0a023035045d03647",
"webgate_ami_id-2": "ami-0a023035045d03647",
"orace_base_prereqs_ami_name": "Oracle79-prereqs-v1_7",
"orace_db_ami_name": "Oracle79-prereqs-v1_7",
"orace_db_dr_ami_name": "EBSDB-DR-test",
Expand Down Expand Up @@ -160,6 +174,13 @@
"ftp_ami_id": "ami-08cd358d745620807",
"ec2_instance_type_clamav": "c5d.large",
"clamav_ami_id": "ami-03e88be9ecff64781",
"ebsdb_ami_id": "ami-04631d406fcf89620",
"ebsapps_ami_id-1": "ami-04631d406fcf89620",
"ebsapps_ami_id-2": "ami-04631d406fcf89620",
"accessgate_ami_id-1": "ami-0ea936e503830d6fe",
"accessgate_ami_id-2": "ami-0ea936e503830d6fe",
"webgate_ami_id-1": "ami-021ff2a4e3544ef7b",
"webgate_ami_id-2": "ami-021ff2a4e3544ef7b",
"orace_base_prereqs_ami_name": "Oracle79-prereqs-v1_8",
"orace_db_ami_name": "Oracle79-prereqs-v1_8",
"orace_db_dr_ami_name": "EBSDB-DR-test",
Expand Down Expand Up @@ -227,6 +248,13 @@
"ftp_ami_id": "ami-08cd358d745620807",
"ec2_instance_type_clamav": "c5d.large",
"clamav_ami_id": "ami-03e88be9ecff64781",
"ebsdb_ami_id": "ami-04631d406fcf89620",
"ebsapps_ami_id-1": "ami-04631d406fcf89620",
"ebsapps_ami_id-2": "ami-04631d406fcf89620",
"accessgate_ami_id-1": "ami-0ea936e503830d6fe",
"accessgate_ami_id-2": "ami-0ea936e503830d6fe",
"webgate_ami_id-1": "ami-021ff2a4e3544ef7b",
"webgate_ami_id-2": "ami-021ff2a4e3544ef7b",
"orace_base_prereqs_ami_name": "Oracle79-prereqs-v1_8",
"orace_db_ami_name": "Oracle79-prereqs-v1_8",
"orace_db_dr_ami_name": "EBSDB-DR-test",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "aws_instance" "ec2_accessgate" {
count = local.application_data.accounts[local.environment].accessgate_no_instances
instance_type = local.application_data.accounts[local.environment].ec2_oracle_instance_type_accessgate
ami = data.aws_ami.accessgate.id
ami = local.application_data.accounts[local.environment]["accessgate_ami_id-${count.index + 1}"]
key_name = local.application_data.accounts[local.environment].key_name
vpc_security_group_ids = [aws_security_group.ec2_sg_accessgate.id]
subnet_id = local.private_subnets[count.index]
Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/ccms-ebs/ccms-ec2-oracle_ebs.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "aws_instance" "ec2_oracle_ebs" {
instance_type = local.application_data.accounts[local.environment].ec2_oracle_instance_type_ebsdb
#ami = data.aws_ami.oracle_db.id
ami = local.environment == "development" ? local.application_data.accounts[local.environment].restored_db_image : data.aws_ami.oracle_db.id
ami = local.application_data.accounts[local.environment].ebsdb_ami_id
key_name = local.application_data.accounts[local.environment].key_name
vpc_security_group_ids = [aws_security_group.ec2_sg_ebsdb.id]
subnet_id = data.aws_subnet.data_subnets_a.id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "aws_instance" "ec2_ebsapps" {
count = local.application_data.accounts[local.environment].ebsapps_no_instances
instance_type = local.application_data.accounts[local.environment].ec2_oracle_instance_type_ebsapps
ami = data.aws_ami.oracle_base_prereqs.id
ami = local.application_data.accounts[local.environment]["ebsapps_ami_id-${count.index + 1}"]
key_name = local.application_data.accounts[local.environment].key_name
vpc_security_group_ids = [aws_security_group.ec2_sg_ebsapps.id]
subnet_id = local.private_subnets[count.index]
Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/ccms-ebs/ccms-ec2-oracle_webgate.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "aws_instance" "ec2_webgate" {
count = local.application_data.accounts[local.environment].webgate_no_instances
instance_type = local.application_data.accounts[local.environment].ec2_oracle_instance_type_webgate
ami = data.aws_ami.webgate.id
ami = local.application_data.accounts[local.environment]["webgate_ami_id-${count.index + 1}"]
key_name = local.application_data.accounts[local.environment].key_name
vpc_security_group_ids = [aws_security_group.ec2_sg_webgate.id]
subnet_id = local.private_subnets[count.index]
Expand Down

0 comments on commit b464bfe

Please sign in to comment.