-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
dynamodb: TableV2 generates bad Logical ID #27062
Labels
@aws-cdk/aws-dynamodb
Related to Amazon DynamoDB
bug
This issue is a bug.
in-progress
This issue is being actively worked on.
p1
Comments
roc13x
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Sep 8, 2023
colifran
added
in-progress
This issue is being actively worked on.
p1
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Sep 8, 2023
mergify bot
pushed a commit
that referenced
this issue
Sep 8, 2023
…is instead of scope (#27075) `CfnGlobalTable` in the constructor of `TableV2` was incorrectly using `scope` instead of `this`. As a result, `TableV2` was not generating correct logical IDs. Closes #27062 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
MrArnoldPalmer
pushed a commit
that referenced
this issue
Sep 8, 2023
…is instead of scope (#27075) `CfnGlobalTable` in the constructor of `TableV2` was incorrectly using `scope` instead of `this`. As a result, `TableV2` was not generating correct logical IDs. Closes #27062 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mikewrighton
pushed a commit
that referenced
this issue
Sep 14, 2023
…is instead of scope (#27075) `CfnGlobalTable` in the constructor of `TableV2` was incorrectly using `scope` instead of `this`. As a result, `TableV2` was not generating correct logical IDs. Closes #27062 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-dynamodb
Related to Amazon DynamoDB
bug
This issue is a bug.
in-progress
This issue is being actively worked on.
p1
Describe the bug
When you declare a TableV2 construct, the table in the resulting CloudFormation template has the logical ID
Resource
with no appended hash value like other types of resources.As a result, multiple TableV2's cannot be declared in the same stack as their IDs will conflict.
Expected Behavior
Declaring a TableV2 with construct ID
DataStore
should result in a template logical ID such asDataStore6B161152
, and declaring multiple tables should be possible.Current Behavior
The resulting logical ID is
Resource
. Declaring multiple tables results in this:Error: There is already a Construct with name 'Resource' in MyTestStack
Reproduction Steps
Possible Solution
I believe the cause of this bug is this line: https://github.com/aws/aws-cdk/blob/ffd4b7d7897c34b43bb5f80edb9c42024df98776/packages/aws-cdk-lib/aws-dynamodb/lib/table-v2.ts#L473C23-L473C23
The scope of the
CfnGlobalTable
resource should bethis
instead ofscope
Additional Information/Context
No response
CDK CLI Version
2.95.0 (build cfa7e88)
Framework Version
No response
Node.js Version
18.15.0
OS
MacOS
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: