简体   繁体   English

是否可以在创建 CloudFormation 堆栈后将标签添加到它?

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

Is there a way to just add tags to existing CloudFormation stacks ?有没有办法只向现有的 CloudFormation 堆栈添加标签? In update stack operation there is away to specify new tags, but is it possible to do it without update (Just like any other resources in AWS) ?在更新堆栈操作中可以指定新标签,但是否可以在不更新的情况下进行(就像 AWS 中的任何其他资源一样)?

No, you cannot add tags to the existing CloudFormation stack without updating the stack.不可以,您不能在不更新堆栈的情况下向现有 CloudFormation 堆栈添加标签。

When you add new Tags to CloudFormation, stack will go to UPDATE_IN_PROGRESS state and updates the wewly added tags to all the supported resources in the stack.当您向UPDATE_IN_PROGRESS添加新标签时,堆栈将进入UPDATE_IN_PROGRESS状态并将刚刚添加的标签更新到堆栈中所有支持的资源。 Updating/Adding tags will not replace the resources.更新/添加标签不会替换资源。 However, I recommend you to check the Resource Tag Properties, before Updating.但是,我建议您在更新之前检查资源标签属性。

I hope this helps!我希望这会有所帮助!

You can create change set with previous template, review the changeset (look out for scope as tag only in the resource description of changeset), and then execute the change set.您可以使用以前的模板创建变更集,查看变更集(仅在变更集的资源描述中查找范围作为标记),然后执行变更集。 For example:例如:

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