aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.47k stars 3.83k forks source link

(Tags): Support case sensitive Tags like Cloudformation #15343

Closed ayozemr closed 1 year ago

ayozemr commented 3 years ago

Aws console handles case sensitive tags, for example tag key "Name" displays name in console for VPCs but not if the tag key is "name". Cloudformation supports case sensitive, but even that CDK pass the tag as "Name" if you define the key, seems internally handles it as insensitive dropping duplicate tags if you define both lowercase and capital case.

Use Case

Tags.of(dynamodb).add("Name", tableName); Tags.of(dynamodb).add("name", tableName); Duplicate tag keys found. Please note that Tag keys are case insensitive.

We use lowercase (As its common practice). Its useful for external monitoring tools but not for aws console, as aws likes them capitalized. To handle this we duplicate them allowing both keys. CDK is not allowing this with a duplicate tag keys found.

Proposed Solution

Support case sensitive tag keys like cloudformation do


This is a :rocket: Feature Request

rix0rrr commented 3 years ago

Needs investigation why we put that check there in the first place.

lxop commented 2 years ago

It seems like some AWS services treat tag keys as case sensitive, and others as case insensitive. As a couple of examples, VPCs can have both Name and name tags held simultaneously, while IAM roles fail to deploy if both Name and name are specified. I'm not sure that this is a CDK problem

evgenyka commented 1 year ago

It seems like some AWS services treat tag keys as case sensitive, and others as case insensitive. To ensure compatibility and consistent behavior across different AWS services, the CDK treats tag keys as case-insensitive.

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.