Skip to content

Commit

Permalink
Fix lifecycle precondition for resource label and custom metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
rotciw committed Apr 30, 2024
1 parent 4736ffc commit fcb300a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,8 @@ resource "aws_appautoscaling_policy" "ecs_service" {

lifecycle {
precondition {
condition = var.autoscaling_resource_label == "" && length(var.custom_metrics) > 0
error_message = "Autoscaling resource labels are for predefined metrics only"
condition = !(var.autoscaling_resource_label != "" && length(var.custom_metrics) > 0)
error_message = "Cannot define autoscaling resource label and custom metrics at the same time"
}
}
}
Expand Down

0 comments on commit fcb300a

Please sign in to comment.