Skip to content

Commit

Permalink
add subnet tags
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Jul 30, 2024
1 parent 3e39778 commit d8fc592
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dns_zones.tf
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,22 @@ resource "aws_vpc" "vpc" {
{ "Name" = "vpc0-dummy" },
)
}
# Tag existing subnets for EKS
# Container subnets under data.aws_subnets.container-subnets
# Load Balance subnets under data.aws_subnets.lb-subnets
resource "aws_ec2_tag" "container-subnets" {
for_each = toset(data.aws_subnets.container-subnets.ids)
resource_id = each.value
key = "kubernetes.io/cluster/${var.cluster_name}"
value = "shared"
}

resource "aws_ec2_tag" "lb-subnets" {
for_each = toset(data.aws_subnets.lb-subnets.ids)
resource_id = each.value
key = "kubernetes.io/role/internal-nlb"
value = "1"
}

#### This is the correct way, it's commented because
#### the module is throwing an error on the for_each
Expand Down

0 comments on commit d8fc592

Please sign in to comment.