Quantcast
Channel: Terraform - HashiCorp Discuss
Viewing all articles
Browse latest Browse all 11461

Terraform aws_appautoscaling_policy not picking up correct step_adjustment bound values

$
0
0

@mpenna wrote:

Hi there,

I have this aws_appautoscaling_policy resource that keeps fetching the wrong values for the upper and lower bounds of its various step_adjustments settings. At some point the configuration state and the corresponding resource have diverged and now everytime I do a plan, Terraform reports back that the configured values (copied from the actual resource) are different form those currently fetched during the planning operation and therefore an update must be performed.

This is the configuration:

resource "aws_appautoscaling_policy" "api_up" {
  name               = "${local.api_name}-scale-up-pol"
  service_namespace  = "ecs"
  resource_id        = "service/${aws_ecs_cluster.default.name}/${aws_ecs_service.api.name}"
  scalable_dimension = "ecs:service:DesiredCount"

  step_scaling_policy_configuration {
    adjustment_type         = "ChangeInCapacity"
    cooldown                = 60
    metric_aggregation_type = "Average"

    step_adjustment {
      metric_interval_lower_bound = 35.0
      metric_interval_upper_bound = 55.0
      scaling_adjustment          = 6
    }

    step_adjustment {
      metric_interval_lower_bound = 55.0
      metric_interval_upper_bound = 75.0
      scaling_adjustment          = 12
    }

    step_adjustment {
      metric_interval_lower_bound = 75.0
      scaling_adjustment          = 18
    }
  }

  depends_on = [aws_appautoscaling_target.api]
}

And this is a screen grab of the policy currently attached to an ECS Service:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 11461

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>