tf_aws_ecs icon indicating copy to clipboard operation
tf_aws_ecs copied to clipboard

Ignore changes to desired_capacity for aws_autoscaling_group

Open afairb opened this issue 5 years ago • 0 comments

The desired capacity of an autoscaling group can be changed externally due to autoscaling rules. This means that this Terraform resource should not try and change/overwrite this value when updating, as this could result in the number of instances being reduced below what is currently required.

From the Terraform docs:

By default, Terraform detects any difference in the current settings of a real infrastructure object and plans to update the remote object to match configuration.

In some rare cases, settings of a remote object are modified by processes outside of Terraform, which Terraform would then attempt to "fix" on the next run. In order to make Terraform share management responsibilities of a single object with a separate process, the ignore_changes meta-argument specifies resource attributes that Terraform should ignore when planning updates to the associated remote object.

The arguments corresponding to the given attribute names are considered when planning a create operation, but are ignored when planning an update.

https://www.terraform.io/docs/configuration/resources.html#ignore_changes

afairb avatar Apr 17 '19 16:04 afairb