I need to apply tags to EBS Internet facing Application Load Balancers. I do not want to apply the tags to the EBS Environment.
My terraform script can apply settings to the ALB using this pattern, this WORKS:
dynamic "setting" {
for_each = var.is_application_load_balancer ? ["include"] : []
content {
name = "AccessLogsS3Enabled"
namespace = "aws:elbv2:loadbalancer"
value = var.access_log_enabled
resource = ""
}
}
dynamic "setting" {
for_each = var.is_application_load_balancer ? ["include"] : []
content {
name = "Protocol"
namespace = "aws:elbv2:listener:443"
value = "HTTPS"
resource = ""
}
}
However, I cannot apply tags using the same pattern. This does NOT work:
dynamic "setting" {
for_each = var.is_application_load_balancer ? ["include"] : []
content {
name = "Tags"
namespace = "aws:elbv2:loadbalancer"
value = module.meta.waf_tags
resource = ""
}
}
Do you have any suggestions on how to apply the tags using terraform?
Thank you