mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-04-26 18:38:49 +02:00
feat: Add ability to tag network-interface using Launch Template (#1563)
This commit is contained in:
@@ -80,6 +80,15 @@ resource "aws_launch_template" "default" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Supplying custom tags to EKS instances ENI's is another use-case for LaunchTemplates
|
||||||
|
tag_specifications {
|
||||||
|
resource_type = "network-interface"
|
||||||
|
|
||||||
|
tags = {
|
||||||
|
CustomTag = "EKS example"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Tag the LT itself
|
# Tag the LT itself
|
||||||
tags = {
|
tags = {
|
||||||
CustomTag = "EKS example"
|
CustomTag = "EKS example"
|
||||||
|
|||||||
@@ -103,6 +103,20 @@ resource "aws_launch_template" "workers" {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Supplying custom tags to EKS instances ENI's is another use-case for LaunchTemplates
|
||||||
|
tag_specifications {
|
||||||
|
resource_type = "network-interface"
|
||||||
|
|
||||||
|
tags = merge(
|
||||||
|
var.tags,
|
||||||
|
{
|
||||||
|
Name = local.node_groups_names[each.key]
|
||||||
|
},
|
||||||
|
lookup(var.node_groups_defaults, "additional_tags", {}),
|
||||||
|
lookup(var.node_groups[each.key], "additional_tags", {})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# Tag the LT itself
|
# Tag the LT itself
|
||||||
tags = merge(
|
tags = merge(
|
||||||
var.tags,
|
var.tags,
|
||||||
|
|||||||
@@ -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
|
tags = var.tags
|
||||||
|
|
||||||
lifecycle {
|
lifecycle {
|
||||||
|
|||||||
Reference in New Issue
Block a user