aws / aws/aws-cdk

(core): stack tags don't work on all resource types

Open
#14,127 7 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-cognito @aws-cdk/core blocked bug effort/small needs-cfn p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

Stack tags don't get assigned on user pool resources.

### Reproduction Steps

```ts
export class ExampleStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
new cognito.UserPool(this, "UserPool");
}
}

const app = new cdk.App();
new ExampleStack(app, "Example", {
tags: {
"app:project": "Example",
"app:environment": "Development",
},
});
```

Run

```shell
cdk deploy
```

### What did you expect to happen?

The created user pool tags include "app:project", "app:environment" and their values.

### What actually happened?

No tags found in created user pool

### Environment

- **CDK CLI Version :** 1.97.0
- **Framework Version:** 1.97.0
- **Node.js Version:** 14
- **OS :** macOS Catalina
- **Language (Version):** TypeScript

### Other

I currently have to workaround like this:

```ts
if (props?.tags) {
for (const [key, value] of Object.entries(props.tags))
cdk.Tags.of(userPool).add(key, value);
}
```

---

This is :bug: Bug Report

Contributor guide

Open the contributing guide

Research direction

Start with the TypeScript implementation behind stack tags and cdk.Tags.of(userPool), using the cognito.UserPool example and the cdk deploy reproduction. Compare tag propagation for user pools with resource types that work; done when deployed user pools contain both app:project and app:environment tags without the manual workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.