-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terraform assumes aws_appautoscaling_policy names are globally unique #751
Comments
Unfortunately I've switched companies, and am no longer setup to test. But from looking back through my description above, I think #1808 is only a partial fix, as it still does not include the resource id. |
This is still an issue. Having scaling policies with same name and attributes but for different |
I have submitted a PR to address this: #3012 |
This has landed in master and will ship with v1.7.1 set to release later this week. Happy Terraform'ing! 🎉 |
This has been released in terraform-provider-aws version 1.7.1. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
This issue was originally opened by @cbroglie as hashicorp/terraform#14302. It was migrated here as part of the provider split. The original body of the issue is below.
AWS only requires the policy name to be unique given a resource id, service namespace, and scalable dimension, but Terraform assumes the policy names are globally unique. This makes the behavior of
aws_appautoscaling_policy
non-deterministic when the same policy name is reused for different resources.Terraform Version
v0.9.4
Affected Resource(s)
Please list the resources as a list, for example:
aws_appautoscaling_policy
Terraform Configuration Files
Our configuration leverages a module named
ecs_autoscaling
, and its contents are here:Then the main configuration file leverages it like this:
Actual Behavior
Since Terraform assumes the names are globally unique, the behavior depends on the order of results from the call to
applicationautoscaling.DescribeScalingPolicies
.Steps to Reproduce
Execute
terraform apply
multiple times and observe that changes are made continuously.Important Factoids
The issue is getAwsAppautoscalingPolicy only passes the policy name and service namespace parameters to
applicationautoscaling.DescribeScalingPolicies
, and uses the first result which matches the policy name. It should also pass the resource id and scalable dimension parameters, and assert that it gets at most 1 result back.The text was updated successfully, but these errors were encountered: