在使用SAM部署时,我试图将标记添加到堆栈中,但它们没有出现。下面可以找到SAM命令代码。
sam deploy --stack-name test-stack --resolve-image-repos --capabilities CAPABILITY_NAMED_IAM --no-fail-on-empty-changeset --template-file ./.aws-sam/build/template.yaml --resolve-s3 --tags Name=test-stack az:zone=infra尽管向cli提供了CloudFormation参数,但是没有在-tag堆栈中创建标记。
有人能告诉我如何将堆栈级别的标记添加到使用SAM部署的CloudFormation堆栈中吗?
发布于 2022-05-13 17:47:20
我建议将它们放在samconfig.toml文件中,比如:
[default.deploy.parameters]
stack_name = "your-application"
s3_bucket = "your-s3-for-cloudformation-stuff"
s3_prefix = "your-folder-name"
...
tags = "Name=\"test-stack\" az:zone=\"infra\""它将标记传播到堆栈的所有资源(包括CloudFormation堆栈本身)。
https://stackoverflow.com/questions/71334104
复制相似问题