feat: Add ability to tag network-interface using Launch Template (#1563)

This commit is contained in:
nikitacr7
2021-09-06 12:25:31 +03:00
committed by GitHub
parent 013afb0cc6
commit 7512f171c9
3 changed files with 43 additions and 0 deletions

View File

@@ -573,6 +573,26 @@ resource "aws_launch_template" "workers_launch_template" {
)
}
tag_specifications {
resource_type = "network-interface"
tags = merge(
{
"Name" = "${coalescelist(aws_eks_cluster.this[*].name, [""])[0]}-${lookup(
var.worker_groups_launch_template[count.index],
"name",
count.index,
)}-eks_asg"
},
var.tags,
{
for tag in lookup(var.worker_groups_launch_template[count.index], "tags", local.workers_group_defaults["tags"]) :
tag["key"] => tag["value"]
if tag["key"] != "Name" && tag["propagate_at_launch"]
}
)
}
tags = var.tags
lifecycle {