Skip to content

Potential logical ID conflict between top-level resource #6421

@eladb

Description

@eladb

If two top-level resources (resources defined directly under a stack) have logical IDs that only differ by non alpha-numeric characters, they will get the same logical ID and will conflict.

Sadly, we can't fix this bug without a breaking change in 1.x, so we should consider fixing this in v2.0.

Reproduction Steps

const stack = new Stack();
const r1 = new Resource(stack, 'a-b');
const r2 = new Resource(stack, 'ab');

In this case, both r1 and r2 will get the logical ID ab because we filter non-alphanumeric characters from the logical ID for top-level resources.

Other

The code is here:

return removeNonAlphanumeric(components[0]);


This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

@aws-cdk/coreRelated to core CDK functionalitybugThis issue is a bug.p2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions