fix: Update autoscaling group tags -> tag to support v4 of AWS provider (#1866)

This commit is contained in:
Bryant Biggs
2022-02-15 08:01:52 -05:00
committed by GitHub
parent 9c9ac81e3a
commit 74ad4b09b7
5 changed files with 23 additions and 55 deletions

View File

@@ -378,6 +378,23 @@ resource "aws_autoscaling_group" "this" {
}
}
dynamic "tag" {
for_each = merge(
{
"Name" = var.name
"kubernetes.io/cluster/${var.cluster_name}" = "owned"
"k8s.io/cluster/${var.cluster_name}" = "owned"
},
var.tags,
)
content {
key = tag.key
value = tag.value
propagate_at_launch = true
}
}
timeouts {
delete = var.delete_timeout
}
@@ -388,34 +405,6 @@ resource "aws_autoscaling_group" "this" {
desired_capacity
]
}
tags = concat(
[
{
key = "Name"
value = var.name
propagate_at_launch = true
},
{
key = "kubernetes.io/cluster/${var.cluster_name}"
value = "owned"
propagate_at_launch = true
},
{
key = "k8s.io/cluster/${var.cluster_name}"
value = "owned"
propagate_at_launch = true
},
],
var.propagate_tags,
[for k, v in var.tags :
{
key = k
value = v
propagate_at_launch = true
}
]
)
}
################################################################################