繁体   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