-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] (type-safe-api) web acl names conflict for multiple apis in same stack with same logical id #750
Comments
Thanks for raising this! We actually have a test for this case here: aws-pdk/packages/type-safe-api/test/construct/type-safe-rest-api.test.ts Lines 164 to 189 in 7afa3b7
I suppose the difference here is that the logical ID of the I imagine you're encountering this issue when you have different APIs with the same logical ID, just nested under different constructs? As a workaround you should be able to change the logical IDs and they won't conflict. To address this properly we should do something similar to what we do for the lambda names: aws-pdk/packages/type-safe-api/src/construct/type-safe-rest-api.ts Lines 129 to 132 in 7afa3b7
Or even better we can use the newer CDK Names utility :) |
Describe the bug
When you create two type-safe-apis within one stack the generated web-acl name collides because both APIs will generate the same web-acl name despite being nested in distinct construct trees.
Looking at the code: https://github.com/aws/aws-pdk/blob/mainline/packages/type-safe-api/src/construct/waf/open-api-gateway-web-acl.ts#L34-L37
The web-acl name is generated from the nearest parent stack only.
Expected Behavior
When two separate api's are created within one stack the generated names will not collide.
Current Behavior
The generated web-acl names collide when you have two apis in one stack.
Reproduction Steps
Possible Solution
Generate the web-acl names with the construct context.
Additional Information/Context
No response
PDK version used
0.23.26
What languages are you seeing this issue on?
Typescript
Environment details (OS name and version, etc.)
Mac, 13.5.2 (22G91)
The text was updated successfully, but these errors were encountered: