-
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_cloudformation_stack_set - operation_preferences argument ignored #33170
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Hey @michalz-rely 👋 Are you able to confirm via the AWS Console, API, or CLI that the setting is not being applied? Can you also supply a sample Terraform configuration that can be used to reproduce the issue, as well as debug logs (redacted as needed)? |
Hi @justinretzolk, I can make some more extensive testing, but here I share my recent work. (also tested and having same behaviour on 5.15.0)
As you can see, on Destroy action of aws_cloudformation_stack_set_instance, operation preferences got ignored. I'm observing the termination process at the moment, and it's removing the resources one account at a time. |
Almost identical to: #30806 |
@andrejskuidins I think it's not related, #30806 is caused by lack of multi-region deployment support #24752 |
@justinretzolk is the information I provided enough evidence or you need more examples? |
Facing the same issue on apply as well. operation_preferences argument gets ignored. |
terraform v1.5.2 So there are two places where I found that the best thing to do is specify the same values for both entities (stack_set and stack_set_instance) or one will override the other which results in the issues you are seeing. Additionally, in regards to I don't recommend using 100 for both failure_tolerance_percentage and max_concurrency_percentage though. Even though that results in the fastest deployment, your stackset will always return successful regardless of actual success. I found 50 50 or 49 49 was a safe strategy for speedy deployments/updates of infrastructure which will return a failure response to terraform if the deployment fails in all accounts. If you need terraform to return success/fail if the deployment fails in only one account though, you're stuck with sequential runtimes unfortunately. Deletion seems to always be sequential from terraform however. Also, I found that haveing multiple stack_set_instance resources associated with a single stack_set resource (on a per-parent-ou basis like I have in this example here: #33785 (comment) which I used to fix a number of other issues I found), will slow down the initial deployment speed of the stack_set, but won't impact future template updates after initial deployment. But again, this assumes that both stack_set and stack_set_instance resources have the |
@evantlueck thanks for your message, but I think this needs to be sorted. I haven't tested your solution, but in general there's no need for setting parameters when defining a stack set, a stack set instance is taking the parameters, see the CLI documentation: |
Just did some investigating, and I believe the underlying issue (if you can call it that, see my theory below) is that the CloudFormation's Interestingly, the (Side note: I also noticed that the new parameter So, a potential naive code fix might be to call For comparison, you can see that the This is why the Related: |
Terraform Core Version
1.5.2
AWS Provider Version
5.0.0
Affected Resource(s)
aws_cloudformation_stack_set
Expected Behavior
Remove operation_preferences from aws_cloudformation_stack_set
Actual Behavior
operation_preferences defined in aws_cloudformation_stack_set are ignored, which leads to confusion.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
no error reported
Steps to Reproduce
First
operation_preferences { max_concurrent_percentage = 100 failure_tolerance_percentage = 100 }
Next
operation_preferences { max_concurrent_percentage = 100 failure_tolerance_percentage = 100 }
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudformation/create-stack-set.html
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudformation/create-stack-instances.html
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: