No AWS Tagging Support on Stacks themselves
See original GitHub issueWhen I saw in another issue that tag propagation was added, my first instinct was to try to set tags on the software.amazon.awscdk.App (not possible, does not implement ITaggable, at least in java), then i tried to set tags on the software.amazon.awscdk.Stack (same problem).
My use case is to (1) add tags on the App level with propagation, that (2) will be set in all the AWS::CloudFormation::Stack resources created by cdk deploy, and in turn (3) will be set on all the resources created within said stacks.
I tried implementing ITaggable on my App subclass and my Stack subclass. The tags get passed and set all the way to the resources all right, so that’s (1) and (3) covered. But what about (2)? If I understand the design correctly, you’re completely reliant on changesets, and the tags for the Stacks cannot be passed in the stack template. They would have to be passed in the api call to createChangeSet:
deploy-stack.ts
const changeSet = await cfn.createChangeSet({
StackName: deployName,
ChangeSetName: changeSetName,
ChangeSetType: update ? 'UPDATE' : 'CREATE',
Description: `CDK Changeset for execution ${executionId}`,
TemplateBody: bodyParameter.TemplateBody,
TemplateURL: bodyParameter.TemplateURL,
Parameters: params,
Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM' ]
# ADD TAGS SOMEWHERE HERE?
}).promise();
Makes sense?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:11 (9 by maintainers)
Top GitHub Comments
@IsmaelMartinez
I totally understand the gap you are closing. Going all the way back to the top, this issue is now focused only on item (2) from @lestephane original bug.
My only point was to @rafcio19 in attempt to clarify for other users. If you only need to tag resources, that problem is solved with the current features and you have more control if needed. If you actually need the describe-stacks API to return tags on the stack, then after your PR is merged this issue will be complete. Thanks for contributing!
Ok, I got a PR almost ready. I just need to go via the Contribute process and hope that I haven’t miss anything. This should get referenced fairly soon.