From b427ae2f848d676d037f3308ff440f0344cda8c5 Mon Sep 17 00:00:00 2001 From: Buckingham Date: Thu, 14 Sep 2023 07:38:41 +0100 Subject: [PATCH] Test_Instance_140923 --- terraform/environments/ppud/ad.tf | 8 ++--- terraform/environments/ppud/instances.tf | 40 +++++++++++------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/terraform/environments/ppud/ad.tf b/terraform/environments/ppud/ad.tf index a876c0dd34e..917f303a4a7 100644 --- a/terraform/environments/ppud/ad.tf +++ b/terraform/environments/ppud/ad.tf @@ -51,11 +51,11 @@ resource "aws_ssm_document" "api_ad_join_domain" { # Associate Policy to Development Instance resource "aws_ssm_association" "ad_join_domain_association_dev" { count = local.is-development == true ? 1 : 0 - depends_on = [aws_instance.s609693lo6vw109, aws_instance.s609693lo6vw105, aws_instance.s609693lo6vw104, aws_instance.s609693lo6vw100, aws_instance.s609693lo6vw101, aws_instance.s609693lo6vw103, aws_instance.s609693lo6vw106, aws_instance.s609693lo6vw107, aws_instance.PPUDWEBSERVER2, aws_instance.s609693lo6vw102, aws_instance.s609693lo6vw108] + depends_on = [aws_instance.s609693lo6vw109, aws_instance.s609693lo6vw105, aws_instance.s609693lo6vw104, aws_instance.s609693lo6vw100, aws_instance.s609693lo6vw101, aws_instance.s609693lo6vw103, aws_instance.s609693lo6vw106, aws_instance.s609693lo6vw107, aws_instance.PPUDWEBSERVER2, aws_instance.s609693lo6vw102, aws_instance.s609693lo6vw108, aws_instance.TestServer1] name = aws_ssm_document.api_ad_join_domain.name targets { key = "InstanceIds" - values = [aws_instance.s609693lo6vw109[0].id, aws_instance.s609693lo6vw105[0].id, aws_instance.s609693lo6vw104[0].id, aws_instance.s609693lo6vw100[0].id, aws_instance.s609693lo6vw101[0].id, aws_instance.s609693lo6vw103[0].id, aws_instance.s609693lo6vw106[0].id, aws_instance.s609693lo6vw107[0].id, aws_instance.PPUDWEBSERVER2[0].id, aws_instance.s609693lo6vw102[0].id, aws_instance.s609693lo6vw108[0].id] + values = [aws_instance.s609693lo6vw109[0].id, aws_instance.s609693lo6vw105[0].id, aws_instance.s609693lo6vw104[0].id, aws_instance.s609693lo6vw100[0].id, aws_instance.s609693lo6vw101[0].id, aws_instance.s609693lo6vw103[0].id, aws_instance.s609693lo6vw106[0].id, aws_instance.s609693lo6vw107[0].id, aws_instance.PPUDWEBSERVER2[0].id, aws_instance.s609693lo6vw102[0].id, aws_instance.s609693lo6vw108[0].id, aws_instance.TestServer1[0].id] } } @@ -74,10 +74,10 @@ resource "aws_ssm_association" "ad_join_domain_association_preprod" { # Associate Policy to PROD Instance resource "aws_ssm_association" "ad_join_domain_association_prod" { count = local.is-production == true ? 1 : 0 - depends_on = [aws_instance.s618358rgvw019, aws_instance.s618358rgvw020, aws_instance.s618358rgvw021, aws_instance.s618358rgvw022, aws_instance.s618358rgvw027, aws_instance.s618358rgvw204, aws_instance.s618358rgvw205, aws_instance.s618358rgsw025p, aws_instance.s618358test] + depends_on = [aws_instance.s618358rgvw019, aws_instance.s618358rgvw020, aws_instance.s618358rgvw021, aws_instance.s618358rgvw022, aws_instance.s618358rgvw027, aws_instance.s618358rgvw204, aws_instance.s618358rgvw205, aws_instance.s618358rgsw025p] name = aws_ssm_document.api_ad_join_domain.name targets { key = "InstanceIds" - values = [aws_instance.s618358rgvw019[0].id, aws_instance.s618358rgvw020[0].id, aws_instance.s618358rgvw021[0].id, aws_instance.s618358rgvw022[0].id, aws_instance.s618358rgvw027[0].id, aws_instance.s618358rgvw204[0].id, aws_instance.s618358rgvw205[0].id, aws_instance.s618358rgsw025p[0].id, aws_instance.s618358test[0].id] + values = [aws_instance.s618358rgvw019[0].id, aws_instance.s618358rgvw020[0].id, aws_instance.s618358rgvw021[0].id, aws_instance.s618358rgvw022[0].id, aws_instance.s618358rgvw027[0].id, aws_instance.s618358rgvw204[0].id, aws_instance.s618358rgvw205[0].id, aws_instance.s618358rgsw025p[0].id] } } diff --git a/terraform/environments/ppud/instances.tf b/terraform/environments/ppud/instances.tf index f9e1de5d4c0..9c0e44cb932 100644 --- a/terraform/environments/ppud/instances.tf +++ b/terraform/environments/ppud/instances.tf @@ -128,6 +128,25 @@ resource "aws_instance" "s609693lo6vw103" { } } +resource "aws_instance" "TestServer1" { + count = local.is-development == true ? 1 : 0 + ami = "ami-070c9a4ee0e5d83d5" + instance_type = "m5.large" + source_dest_check = false + iam_instance_profile = aws_iam_instance_profile.ec2_profile.id + vpc_security_group_ids = [aws_security_group.Primary-DOC-Server[0].id] + subnet_id = data.aws_subnet.private_subnets_b.id + + metadata_options { + http_tokens = "required" + http_endpoint = "enabled" + } + + tags = { + Name = "TestServer1" + } +} + resource "aws_instance" "s609693lo6vw106" { count = local.is-development == true ? 1 : 0 ami = "ami-0f9ea6b08039bb33b" @@ -496,27 +515,6 @@ resource "aws_instance" "s618358rgvw205" { } } -# Test Server - -resource "aws_instance" "s618358test" { - count = local.is-production == true ? 1 : 0 - ami = "ami-070c9a4ee0e5d83d5" - instance_type = "m5.large" - source_dest_check = false - iam_instance_profile = aws_iam_instance_profile.ec2_profile.id - vpc_security_group_ids = [aws_security_group.Bridge-Server[0].id] - subnet_id = data.aws_subnet.private_subnets_a.id - - metadata_options { - http_tokens = "required" - http_endpoint = "enabled" - } - - tags = { - Name = "s618358test" - is-production = true - } -} resource "aws_instance" "s618358rgsw025p" { count = local.is-production == true ? 1 : 0