如果更新已经发生,我如何重试 AWS CloudFormation 更新?
How can I retry a AWS CloudFormation update if an update is already happening?
尝试实现 CI,每次提交都会触发 CFN 更新。我如何检查是否有更新并强制我的脚本等待或安排在未来某个时间重试?
我看到有一个 describe-stack-events,但这给了我一个列表,而不是最近的事件。有简化版吗?
aws cloudformation describe-stack-events --profile dev --stack-name name --max-items 1
找到解决方案:
aws cloudformation wait stack-update-complete --stack-name name --profile dev
我在测试脚本时使用的单行代码(并假设会出现故障)。它运行脚本,等待更新完成,然后 returns 导致问题的事件。
aws cloudformation update-stack --stack-name name --template-body file://stack.yaml && aws cloudformation wait stack-update-complete --stack-name name || aws cloudformation describe-stack-events --stack-name name | grep -B2 -A8 CREATE_FAILED
尝试实现 CI,每次提交都会触发 CFN 更新。我如何检查是否有更新并强制我的脚本等待或安排在未来某个时间重试?
我看到有一个 describe-stack-events,但这给了我一个列表,而不是最近的事件。有简化版吗?
aws cloudformation describe-stack-events --profile dev --stack-name name --max-items 1
找到解决方案:
aws cloudformation wait stack-update-complete --stack-name name --profile dev
我在测试脚本时使用的单行代码(并假设会出现故障)。它运行脚本,等待更新完成,然后 returns 导致问题的事件。
aws cloudformation update-stack --stack-name name --template-body file://stack.yaml && aws cloudformation wait stack-update-complete --stack-name name || aws cloudformation describe-stack-events --stack-name name | grep -B2 -A8 CREATE_FAILED