Skip to content

Commit

Permalink
Merge pull request #757 from Atralupus/remove-tags
Browse files Browse the repository at this point in the history
Remove node group tags in terraform
  • Loading branch information
Atralupus authored Oct 12, 2023
2 parents eacf8fa + 53b1cfa commit d6e3770
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions 9c-main/terraform/node_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,69 +35,3 @@ resource "aws_eks_node_group" "node_groups" {
aws_subnet.public
]
}

# EKS can't directly set the "Name" tag, so we use the autoscaling_group_tag resource.
resource "aws_autoscaling_group_tag" "node_name_tag" {

for_each = toset([for node in aws_eks_node_group.node_groups : node.resources[0].autoscaling_groups[0].name])

autoscaling_group_name = each.value

tag {
key = "Name"
value = each.value
propagate_at_launch = true
}
}

resource "aws_autoscaling_group_tag" "node_service_tag" {

for_each = toset([for node in aws_eks_node_group.node_groups : node.resources[0].autoscaling_groups[0].name])

autoscaling_group_name = each.value

tag {
key = "Service"
value = aws_eks_cluster.cluster.name
propagate_at_launch = true
}
}

resource "aws_autoscaling_group_tag" "node_environment_tag" {

for_each = toset([for node in aws_eks_node_group.node_groups : node.resources[0].autoscaling_groups[0].name])

autoscaling_group_name = each.value

tag {
key = "Environment"
value = "production"
propagate_at_launch = true
}
}

resource "aws_autoscaling_group_tag" "node_owner_tag" {

for_each = toset([for node in aws_eks_node_group.node_groups : node.resources[0].autoscaling_groups[0].name])

autoscaling_group_name = each.value

tag {
key = "Owner"
value = "jihyung"
propagate_at_launch = true
}
}

resource "aws_autoscaling_group_tag" "node_team_tag" {

for_each = toset([for node in aws_eks_node_group.node_groups : node.resources[0].autoscaling_groups[0].name])

autoscaling_group_name = each.value

tag {
key = "Team"
value = "game"
propagate_at_launch = true
}
}

0 comments on commit d6e3770

Please sign in to comment.