簡體   English   中英

如果已經發生更新,我該如何重試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

更多詳情請訪問: https//docs.aws.amazon.com/cli/latest/reference/cloudformation/wait/index.html#cli-aws-cloudformation-wait

我在測試腳本時使用的單線程(假設會出現故障)。 它運行腳本,等待更新完成,然后返回導致問題的事件。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM