-
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
TableV2: TableV2 Replica provides the incorrect TableStreamARN in CDK #31335
Comments
Hi @kevinhuynh23 , Thanks for reaching out. you seem to be using very old version of CDK. Could you please try running on the latest CDK 2.156. Meanwhile I will also try to reproduce this on my end. |
Hi @khushail, thanks for looking to this! We are stuck on CDK 2.87.0 due to some of our dependencies. We can look into upgrading to the latest version if there's a fix for it in the later versions! Thanks! |
Hi @khushail, I had sometime to work around the dependency and I tried testing the same thing on 2.155.0 and seeing the same result! |
Hi @kevinhuynh23 , thanks for replying back with your updates. //create a global table with replica in other regions
const globalTable = new cdk.aws_dynamodb.TableV2(this, 'MyTable', {
tableName: 'MyTable',
partitionKey: { name: 'id', type: cdk.aws_dynamodb.AttributeType.STRING },
removalPolicy: cdk.RemovalPolicy.DESTROY,
});
//globaltable stream arn
new cdk.CfnOutput(this, 'GlobalTableStreamArn', {
value: globalTable.tableStreamArn!,
});
//add replicas to the table
globalTable.addReplica({ region: 'us-west-1', deletionProtection: true });
//get the streamarn for the replicat table from region us-west-1
new cdk.CfnOutput(this, 'ReplicaTableArn', {
value: globalTable.replica('us-west-1').tableStreamArn!,
}); Here is the output printed with incomplete arn - As seen in the cdk code, this replica table is lazily created.
I am still figuring out the root cause, will share updates soon. Thanks for having patience |
@kevinhuynh23 , here is my observation from the code which states the stream as This method adds replica in another region with the stream arn ending with
Linked PR - e52acd8 RFC -https://github.com/aws/aws-cdk-rfcs/blob/main/text/0510-dynamodb-global-table.md So It seems to be intentional the way replica arn is created. cc: @pahud |
@khushail Thanks for looking into this issue! The reason the above comment mentions an addition of a potential lookup function to determine the stream arn, are there any plans to implement this? Also, are we not able to have the Replica Stream ARN be exported as a CloudFormation export value after the creation completes? Or does CFN have no ability to reference the value? Thanks for the help! |
@kevinhuynh23 , I highly doubt if the replica stream ARN could be exported as value but will definitely keep looking and share here if I find anything. Also, I did not find any such implementation plan for the mentioned function. However you could file a feature request with CDK, and get community upvotes for getting it prioritised. |
@kevinhuynh23 , I would be closing this issue for now. If you need any other help/guidance, please feel free to re-open. Thanks ! |
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
When using Global Tables with TableV2 in CDK, the replica tables aren't referenced properly with an output export like the primary Global Table Stream ARN. For example, we create a global table in us-east-1 with replicas in us-west-2 and eu-west-1.
When getting the Stream ARN for the primary global table, CDK will create reference the exact Stream ARN i.e.
arn:aws:dynamodb:us-east-1:123456789012:table/IndraMembershipDetails-Beta/stream/<timestamp>
. Where as in the replica tables when usingglobalTable.replica("us-west-2")
, it'll get the correct replica table, but the Stream ARN provided is not the exact Stream ARN, but something like this instead:arn:aws:dynamodb:us-west-2:123456789012:table/IndraMembershipDetails-Beta/stream/*
.Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
I would expect to use
globalTable.replica("us-west-2")
and retrieve the replica Stream ARN to asarn:aws:dynamodb:us-west-2:123456789012:table/IndraMembershipDetails-Beta/stream/<timestamp>
.Current Behavior
When getting the Stream ARN for the primary global table, CDK will create reference the exact Stream ARN i.e.
arn:aws:dynamodb:us-east-1:123456789012:table/IndraMembershipDetails-Beta/stream/<timestamp>
. Where as in the replica tables when usingglobalTable.replica("us-west-2")
, it'll get the correct replica table, but the Stream ARN provided is not the exact Stream ARN, but something like this instead:arn:aws:dynamodb:us-west-2:123456789012:table/IndraMembershipDetails-Beta/stream/*
.Reproduction Steps
globalTable.replica("us-west-2")
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.87.0
Framework Version
No response
Node.js Version
v20.17.0
OS
Mac OS Sonoma 14.6.1
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: