-
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
[Bug]: aws_autoscaling_policy is often missed from the plan or state #34408
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
I've checked one of the recent failing deployments, and found that the issue happens during the initial resource creation. Below are pieces of logs from the work on an empty state (completely new deployment). Everything is looking good on the plan:
In the application, it looks ok in the beginning:
But then, only three are reporting the success:
And eventually the following error is thrown:
Here is the issue - somewhere the target policy is created twice and this makes TF failing on already existing resource. Nobody except TF was able to create this resource because there was nothing. When I check the problematic autoscaling group, I can see three policies created. I delete them all and on the next run TF succeeds. |
Probably, this is a problem in our configuration but there's a bug on the AWS side that allows creating two |
Terraform Core Version
1.5.0
AWS Provider Version
4.67.0
Affected Resource(s)
aws_autoscaling_policy
Expected Behavior
aws_autoscaling_policy
resources are handled properly.Actual Behavior
I'm getting the following errors randomly:
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
I have the following configurations for autoscaling policies:
Steps to Reproduce
Unknown
Debug Output
No response
Panic Output
No response
Important Factoids
The issue happens randomly when I'm updating an existing configuration. During the plan, it looks like it misses one of the policies from the plan and doesn't refresh it:
Then, it plans to add the "missing" policy:
And on the apply, it fails with the message above because the policy already exists (see above).
I don't do manual changes to the infrastructure. And the issue is happening randomly. Sometimes everything is fine, sometimes not on the same configuration.
How to fix it?
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: