Skip to content

Commit

Permalink
Merge pull request #1099 from alphagov/remove-unused-nats
Browse files Browse the repository at this point in the history
Remove old NATs in staging and production
  • Loading branch information
theseanything authored Jan 29, 2024
2 parents 04957b6 + 73588a2 commit 31949a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions terraform/deployments/cluster-infrastructure/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ resource "aws_route" "public_internet_gateway" {
}

resource "aws_eip" "eks_nat" {
for_each = var.eks_public_subnets
for_each = length(var.eks_licensify_gateways) == 0 ? var.eks_public_subnets : {}
vpc = true
tags = { Name = "${var.cluster_name}-eks-nat-${each.key}" }
# TODO: depends_on = [aws_internet_gateway.gw] once we've imported the IGW from govuk-aws.
}

resource "aws_nat_gateway" "eks" {
for_each = var.eks_public_subnets
for_each = length(var.eks_licensify_gateways) == 0 ? var.eks_public_subnets : {}
allocation_id = aws_eip.eks_nat[each.key].id
subnet_id = aws_subnet.eks_public[each.key].id
tags = { Name = "${var.cluster_name}-eks-${each.key}" }
Expand Down

0 comments on commit 31949a8

Please sign in to comment.