diff --git a/main.tf b/main.tf index 364e1dc..dcee575 100644 --- a/main.tf +++ b/main.tf @@ -290,9 +290,10 @@ resource "aws_appautoscaling_target" "this" { tags = var.tags lifecycle { - ignore_changes = [ + ignore_changes = var.autoscaling_tags_ignore ? [ + tags, tags_all, - ] + ] : [] } } diff --git a/variables.tf b/variables.tf index 8b49969..b14c1d3 100644 --- a/variables.tf +++ b/variables.tf @@ -590,6 +590,12 @@ variable "autoscaling_target_connections" { default = 700 } +variable "autoscaling_tags_ignore" { + description = "Scalable targets created before 2023-03-20 cannot use tags or default_tags. To prevent terraform plan showing differences that can never be reconciled, set this flag to true" + type = bool + default = false +} + ################################################################################ # Security Group ################################################################################