diff --git a/terraform/account/region/network.tf b/terraform/account/region/network.tf index 0414662dfe..170fbc05b8 100644 --- a/terraform/account/region/network.tf +++ b/terraform/account/region/network.tf @@ -15,31 +15,20 @@ data "aws_availability_zones" "default" { provider = aws.region } -# TODO: Remove this once the above data source has been put into state -resource "aws_key_pair" "foo" { - count = 3 - key_name = "temporary-testing-keypair-${element(data.aws_availability_zones.default.names, count.index)}" - public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 temporary-testing-keypair" -} - -#TODO: Fix this by changing availability_zone to a data source resource "aws_default_subnet" "public" { - count = 3 - availability_zone = local.availability_zones[count.index] - # availability_zone = data.aws_availability_zones.default.names[count.index] + count = 3 + availability_zone = element(data.aws_availability_zones.default.names, count.index) map_public_ip_on_launch = false tags = { "Name" = "public" } provider = aws.region } -#TODO: Fix this by changing availability_zone to a data source resource "aws_subnet" "private" { - count = 3 - cidr_block = cidrsubnet(aws_default_vpc.default.cidr_block, 4, count.index + 3) - vpc_id = aws_default_vpc.default.id - availability_zone = local.availability_zones[count.index] - # availability_zone = element(data.aws_availability_zones.default.names, count.index) + count = 3 + cidr_block = cidrsubnet(aws_default_vpc.default.cidr_block, 4, count.index + 3) + vpc_id = aws_default_vpc.default.id + availability_zone = element(data.aws_availability_zones.default.names, count.index) map_public_ip_on_launch = false tags = { "Name" = "private" } diff --git a/terraform/account/region/s3_redacted_logs.tf b/terraform/account/region/s3_redacted_logs.tf index 05d97463d1..9f917bf8d3 100644 --- a/terraform/account/region/s3_redacted_logs.tf +++ b/terraform/account/region/s3_redacted_logs.tf @@ -1,9 +1,7 @@ module "redacted-logs" { - source = "./modules/s3_bucket" - #TODO: Fix this by changing availability_zone to a data source. - account_name = var.environment_name - bucket_name = "opg-use-an-lpa-redacted-logs-${var.environment_name}-eu-west-1" - # bucket_name = "opg-use-an-lpa-redacted-logs-${var.environment_name}-${data.aws_region.current.name}" + source = "./modules/s3_bucket" + account_name = var.environment_name + bucket_name = "opg-use-an-lpa-redacted-logs-${var.environment_name}-${data.aws_region.current.name}" expiration_days = 400 # Log Retention is 13 Months/400 Days as Policy force_destroy = false kms_key = aws_kms_key.redacted_s3 diff --git a/terraform/account/region/vpc_endpoints.tf b/terraform/account/region/vpc_endpoints.tf index a28470c295..1d7418e25f 100644 --- a/terraform/account/region/vpc_endpoints.tf +++ b/terraform/account/region/vpc_endpoints.tf @@ -1,7 +1,5 @@ resource "aws_security_group" "vpc_endpoints_private" { - #TODO: Fix name_prefix - name_prefix = "vpc-endpoint-access-private-subnets-eu-west-1" - # name_prefix = "vpc-endpoint-access-private-subnets-${data.aws_region.current.name}" + name_prefix = "vpc-endpoint-access-private-subnets-${data.aws_region.current.name}" description = "vpc endpoint private sg" vpc_id = aws_default_vpc.default.id tags = { Name = "vpc-endpoint-access-private-subnets-${data.aws_region.current.name}" }