Closed lturcsanyi closed 7 months ago
Not sure if I agree that the stackCreateComplete waiter should account for update statuses, but in the end this is a decision that the service team must do. I'll raise this to the CloudFormation team, as they own the waiter model.
Moving this to the central aws/aws-sdk
repo for visibility to other SDKs. I'll also change this to a feature request, as it's an improvement more than a bug.
Not sure if I agree that the stackCreateComplete waiter should account for update statuses, but in the end this is a decision that the service team must do. I'll raise this to the CloudFormation team, as they own the waiter model.
Moving this to the central
aws/aws-sdk
repo for visibility to other SDKs. I'll also change this to a feature request, as it's an improvement more than a bug.
Thanks for your comment, but the waiter not recognizing CREATE_COMPLETE due to an update being made is definitely a bug and not a feature request.
Thanks for your comment, but the waiter not recognizing CREATE_COMPLETE due to an update being made is definitely a bug and not a feature request.
I agree. AWS also has features that allow automatic modification of CF stack, like AWS Lambda function, so its a valid scenario and I think the SDK should recognize such modifications.
If the CloudFormation team updates their waiter model, the change will be reflected in all SDKs.
I changed this to a feature request because right now the StackCreateComplete is working as expected. Recognizing the UPDATE statuses is an improvement on the current behavior.
Community note: if you are interested in this change, add a 👍 to the original description to help with prioritization.
P103984657
Good news, everyone!
CloudFormation is making the change. They are actively working on their waiter model to add "update" status to the StackCreateComplete, the change will be released in the near future.
The change was released.
Java SDK v2 2.21.38
includes the change. If you are using a different SDK, check their changelog for this entry:
AWS CloudFormation -
- Including UPDATE_* states as a success status for CreateStack waiter.
This issue is now closed.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
The SDK uses the following class to wait for CF stack creation: software.amazon.awssdk.services.cloudformation.waiters.DefaultCloudFormationWaiter Generated from this file: https://github.com/aws/aws-sdk-java-v2/blob/04dffd75e4b045c913a6115628baa73f7cf6697e/services/cloudformation/src/main/resources/codegen-resources/waiters-2.json#L21
Currently, it checks for the following statuses: CREATE_COMPLETE, CREATE_FAILED, DELETE_COMPLETE, DELETE_FAILED, ROLLBACK_COMPLETE, ROLLBACK_FAILED.
The waiter polls the DescribeStack endpoint and checks for the statuses above. If something (e.g. an AWS lambda function automatically) modifies the newly created stack between two polling attempts, then the CloudFormation stack will be in UPDATE_COMPLETE status instead of CREATE_COMPLETE. This means that the waiter will never return successfully.
The waiter in the AWS SDK should check the UPDATE_COMPLETE and UPDATE_FAILED statuses as well.
Expected Behavior
The waiter in the AWS SDK should check the UPDATE_COMPLETE and UPDATE_FAILED statuses as well and return successfully even if something modifies the created CloudFormation stack.
Current Behavior
The CF stack was modified between two polling attempts, thus the CF stack was in UPDATE_COMPLETE status and the waiter never realized that the CF stack was created successfully.
Reproduction Steps
Possible Solution
The waiter in the AWS SDK should check the UPDATE_COMPLETE and UPDATE_FAILED statuses as well and return successfully even if something modifies the created CloudFormation stack.
Additional Information/Context
No response
AWS Java SDK version used
2.20.35
JDK version used
17
Operating System and version
N\A