question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No AWS Tagging Support on Stacks themselves

See original GitHub issue

When 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:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
moofish32commented, Apr 5, 2019

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

1reaction
IsmaelMartinezcommented, Apr 5, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tagging AWS resources - AWS General Reference
Consider tag guidelines that support multiple purposes, like managing resource access control, cost tracking, automation, and organization.
Read more >
Setting AWS CloudFormation stack options
Set options for your AWS CloudFormation stacks like tags, notification of stack events, or a stack policy.
Read more >
Resource tag - AWS CloudFormation
Applies user-defined tags to supported resource types by using the Resource ... CloudFormation automatically creates the following stack-level tags with the ...
Read more >
Tagging - AWS Cloud Development Kit (AWS CDK) v2
Tags are not applied across Stage boundaries. ... Tags support properties that fine-tune how tags are applied to, or removed from, resources.
Read more >
Controlling access to AWS resources using tags
AWS services that support tags might allow you to create multiple tag key names that differ only by case, such as tagging an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found