Skip to content
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): DeletionPolicy is not propagated to replicas #17011

Open
TheSPD opened this issue Oct 15, 2021 · 3 comments
Open

(aws-dynamodb): DeletionPolicy is not propagated to replicas #17011

TheSPD opened this issue Oct 15, 2021 · 3 comments
Labels
@aws-cdk/aws-dynamodb Related to Amazon DynamoDB bug This issue is a bug. ddb-legacy-table This issue has to do with DynamoDB's legacy Table construct. Close after migration guide is out. effort/small Small work item – less than a day of effort p2

Comments

@TheSPD
Copy link
Contributor

TheSPD commented Oct 15, 2021

What is the problem?

When a Table is created with multiple replicationRegions, the retention policy is not propagated to the Custom::DynamoDBReplica resources that get created under cloudformation.

Reproduction Steps

  1. Create a table using with multiple replica regions
.
.
new Table(stack, 'Table', {
      partitionKey: {
        name: 'id',
        type: AttributeType.STRING,
      },
      replicationRegions: [
        'eu-west-2',
        'eu-central-1',
      ],
      removalPolicy: RemovalPolicy.RETAIN,
});
.
.  
  1. Deploy CDK Stack
  2. Remove Table from code and redeploy CDK Stack

What did you expect to happen?

we expect the table in main region as well as the replicas to be retained after removing the CDK resource.

What actually happened?

we see that the table in main region is retained but the replicas are deleted after removing the CDK resource.

CDK CLI Version

1.126.0

Framework Version

No response

Node.js Version

14.16.1

OS

Linux

Language

Typescript

Language Version

No response

Other information

No response

@TheSPD TheSPD added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 15, 2021
@github-actions github-actions bot added the @aws-cdk/aws-dynamodb Related to Amazon DynamoDB label Oct 15, 2021
@peterwoodworth peterwoodworth added p1 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Oct 15, 2021
@skinny85 skinny85 added the in-progress This issue is being actively worked on. label Oct 18, 2021
@skinny85 skinny85 removed their assignment Oct 18, 2021
@jakepearson
Copy link

Hi, is there any update on this ticket?

@madeline-k madeline-k removed the in-progress This issue is being actively worked on. label Jun 14, 2022
@Goncharo
Copy link

Goncharo commented Jan 11, 2023

Related to #18582 - here it's the PITR setting that is not propagated to replica tables.

@rix0rrr
Copy link
Contributor

rix0rrr commented Sep 21, 2023

This issue was for the existing Table construct, which used custom resources to implement table replication. We no longer recommend the use of the Table construct.

Instead, the TableV2 construct has been released in 2.95.1 (#27023) which maps to the AWS::DynamoDB::GlobalTable resource, has better support for replication and does not suffer from the issue described here.


Be aware that there are additional deployment steps involved in a migration from Table to TableV2. You need to do a RETAIN deployment, a delete deployment, then change the code to use TableV2 and then use cdk import. A link to a full guide will be posted once it is available.

Here are some other resources to get you started (using CfnGlobalTable instead of TableV2) if you want to get going on the migration:

@rix0rrr rix0rrr added the ddb-legacy-table This issue has to do with DynamoDB's legacy Table construct. Close after migration guide is out. label Sep 21, 2023
@pahud pahud added p2 and removed p1 labels Jun 11, 2024
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. ddb-legacy-table This issue has to do with DynamoDB's legacy Table construct. Close after migration guide is out. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants