簡體   English   中英

是否可以在創建 CloudFormation 堆棧后將標簽添加到它?

[英]Is it possible to just add tags to CloudFormation stack after it is created?

有沒有辦法只向現有的 CloudFormation 堆棧添加標簽? 在更新堆棧操作中可以指定新標簽,但是否可以在不更新的情況下進行(就像 AWS 中的任何其他資源一樣)?

不可以,您不能在不更新堆棧的情況下向現有 CloudFormation 堆棧添加標簽。

當您向UPDATE_IN_PROGRESS添加新標簽時,堆棧將進入UPDATE_IN_PROGRESS狀態並將剛剛添加的標簽更新到堆棧中所有支持的資源。 更新/添加標簽不會替換資源。 但是,我建議您在更新之前檢查資源標簽屬性。

我希望這會有所幫助!

您可以使用以前的模板創建變更集,查看變更集(僅在變更集的資源描述中查找范圍作為標記),然后執行變更集。 例如:

aws cloudformation create-change-set --stack-name test--change-set-name test --use-previous-template --parameters file://test.parameters  --tags Key=TestKey,Value=TestValue --capabilities CAPABILITY_IAM

aws cloudformation describe-change-set --stack-name test --change-set-name test

aws cloudformation execute-change-set --stack-name test --change-set-name test

暫無
暫無

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

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