-
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
(aws-dynamodb): No replica created when new table created via Update event #12332
Labels
@aws-cdk/aws-dynamodb
Related to Amazon DynamoDB
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p1
Comments
tom-noble
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Jan 4, 2021
tom-noble
changed the title
Dynamo DB Replication: No replica created when new table created via Update event
(aws-dynamodb): No replica created when new table created via Update event
Jan 4, 2021
skinny85
added
effort/medium
Medium work item – several days of effort
p1
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Jan 4, 2021
Any updates on this? |
jogold
added a commit
to jogold/aws-cdk
that referenced
this issue
Feb 26, 2021
jogold
added a commit
to jogold/aws-cdk
that referenced
this issue
Feb 26, 2021
mergify bot
pushed a commit
that referenced
this issue
Mar 5, 2021
Process `Update` events resulting from table replacements. Include the table name in the physical resource id to receive a `Delete` event when the table is replaced. This allows to clean "old" replicas. Use a managed policy instead of an inline policy for the custom resource. An update of the description property of a managed policy requires a replacement. If we use the table name in the description it forces a managed policy replacement when the table name changes. This way we preserve permissions to delete old replicas in case of a table replacement: a new managed policy with permissions for the new table is created during the update phase and the old managed policy with permissions for the old table is removed only during the update clean up phase. The logical ID of the `SourceTableAttachedPolicy` needs to be updated because CF doesn't allow to change a resource type. Closes #12332 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
cornerwings
pushed a commit
to cornerwings/aws-cdk
that referenced
this issue
Mar 8, 2021
Process `Update` events resulting from table replacements. Include the table name in the physical resource id to receive a `Delete` event when the table is replaced. This allows to clean "old" replicas. Use a managed policy instead of an inline policy for the custom resource. An update of the description property of a managed policy requires a replacement. If we use the table name in the description it forces a managed policy replacement when the table name changes. This way we preserve permissions to delete old replicas in case of a table replacement: a new managed policy with permissions for the new table is created during the update phase and the old managed policy with permissions for the old table is removed only during the update clean up phase. The logical ID of the `SourceTableAttachedPolicy` needs to be updated because CF doesn't allow to change a resource type. Closes aws#12332 ---- *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.
effort/medium
Medium work item – several days of effort
p1
Reproduction Steps
What did you expect to happen?
Since a new table is created as part of the update, I expected the new table to be automatically replicated and the deployment to succeed.
What actually happened?
CDK attempts to create a new table with the new partition key but a replica is not created. This causes the DynamoDBReplica custom resource to hang in the UPDATE_COMPLETE_CLEANUP_IN_PROGRESS state.
This eventually fails the deployment due to timeout
Environment
Other
I think the reason this happens is that despite creating a new table the event is marked as an Update (shown below).
The code generated by CDK to handle DynamoDB replication only checks for Create and Delete events, so a replica isn't created (shown below).
This is reinforced by the fact that deleting and rebuilding the stack fixes the issue. CDK attempts to Create the table from scratch, rather than Update an existing one, and a replica is created successfully. If I update the partition key of the table again, I expect to run into this issue again.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: