- 新しい順
- 投票が多い順
- コメントが多い順
Hello,
From the description, I understand that you are using a Custom Go SDK script to perform DescribeStacks
operation to make a waitForStackOperationComplete
function and you would like to know if there is any other simpler/better way to implement such function to add delay while the CloudFormation stack reaches a terminal state.
I would like to inform you that your SDK approach looks valid and I do not see anything immediately incorrect. However, please do note that my expertise with Go language is little limited, however the overall approach is fine.
Further, I checked for any existing methods which can do the polling part to check the stack status implicitly and I was able to find "wait" commands reference in AWS CLI. These commands are essentially used to wait until a particular condition is satisfied where each subcommand polls an API until the listed requirement is met.
You can also find the above reference in Go SDK by searching for the methods with term "Waiters" in the SDK v1 doc and SDK v2 doc.
Kindly also note that while investigating more about the wait commands, I came across two Open GitHub issues[1][2]. These are feature requests to enable CloudFormation to wait for any final state, and display events while waiting instead of the specific waiters for each state as per the current SDK Waiter methods.
Another workaround mentioned in the comments was to use a third party Nodejs module "aws-cloudformation-wait-ready". As per the description, it is similar to aws cloudformation wait stack-update-complete
but waits for any stack status where an update should be allowed. However, I could not find any Go SDK equivalent atleast as per my research. Hence, you can check their approach to handle the issue and implement the same in Go (if you find it better).
Based on all the above investigation and findings, it is safe to conclude that at the moment, a Custom Go SDK script is needed until the above feature is released and make its way into SDK eventually.