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

(dynamodb): deletion policy not applied to replicas from global tables #20220

Closed
esiefkas opened this issue May 4, 2022 · 3 comments
Closed
Assignees
Labels
@aws-cdk/aws-dynamodb Related to Amazon DynamoDB effort/medium Medium work item – several days of effort feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs feature-request A feature should be added or improved. p1

Comments

@esiefkas
Copy link

esiefkas commented May 4, 2022

Describe the bug

When provisioning a DynamoDB table with replication enabled, the removal policy is only applied to the primary table, not the replicas.

Expected Behavior

All tables (primary and replicas) should have the same removal policy applied.

Current Behavior

Primary has the selected deletion policy applied, all replicas have the DESTROY deletion policy

Reproduction Steps

const globalTable = new dynamodb.Table(this, 'Table', {
  partitionKey: { name: 'id', type: dynamodb.AttributeType.STRING },
  replicationRegions: ['us-east-1', 'us-east-2', 'us-west-2'],
  billingMode: dynamodb.BillingMode.PROVISIONED,
  removalPolicy: RemovalPolicy.RETAIN,
});

Possible Solution

This may be intended? If so what is the rationale?

Additional Information/Context

No response

CDK CLI Version

1.152.0

Framework Version

No response

Node.js Version

16.13.0

OS

OSX

Language

Typescript

Language Version

No response

Other information

No response

@esiefkas esiefkas added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 4, 2022
@github-actions github-actions bot added the @aws-cdk/aws-dynamodb Related to Amazon DynamoDB label May 4, 2022
@peterwoodworth peterwoodworth added feature-request A feature should be added or improved. p1 effort/medium Medium work item – several days of effort feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 4, 2022
@peterwoodworth
Copy link
Contributor

This is similar to this issue #18582, in that we use custom resources to implement this instead of the CfnGlobalTable resource. That could potentially be a better choice here. The way CDK typically sets deletion policy is through the CfnResource DeletionPolicy attribute, which resources created through custom resources can't make use of.

On a quick look through the docs Adam linked related to the SDK call, I wasn't able to find anything related to deletion policy. Do you know of a way to do this with the SDK call we're using?

@skinny85
Copy link
Contributor

skinny85 commented May 4, 2022

Thanks for opening the issue @esiefkas. This is a duplicate of #17011, so let's try to keep the conversation there 🙂.

Thanks,
Adam

@skinny85 skinny85 closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2022
@github-actions
Copy link

github-actions bot commented May 4, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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 effort/medium Medium work item – several days of effort feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs feature-request A feature should be added or improved. p1
Projects
None yet
Development

No branches or pull requests

3 participants