Skip to content

Commit

Permalink
Fix provider default tags tf plan pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
FurqanHabibi authored Apr 26, 2024
1 parent b816c35 commit d87bd2e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/core/ecs-autoscaling-target/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
resource "aws_appautoscaling_target" "ecs_target" {
count = var.ignore_capacity_changes ? 0 : 1

# Workaround for https://github.com/hashicorp/terraform-provider-aws/issues/31261
lifecycle {
ignore_changes = [tags_all]
}

min_capacity = var.min_capacity
max_capacity = var.max_capacity
resource_id = "service/${var.ecs_cluster_name}/${var.ecs_service_name}"
Expand All @@ -11,8 +16,9 @@ resource "aws_appautoscaling_target" "ecs_target" {
resource "aws_appautoscaling_target" "ecs_target_ignore_capacity_changes" {
count = var.ignore_capacity_changes ? 1 : 0

# Workaround for https://github.com/hashicorp/terraform-provider-aws/issues/31261
lifecycle {
ignore_changes = [min_capacity, max_capacity]
ignore_changes = [min_capacity, max_capacity, tags_all]
}

min_capacity = var.min_capacity
Expand Down

0 comments on commit d87bd2e

Please sign in to comment.