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] replicationRegions sets billing to PAY_PER_REQUEST and autoScaleReadCapacity will fail #10572

Closed
rjcoelho opened this issue Sep 28, 2020 · 4 comments
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

@rjcoelho
Copy link

rjcoelho commented Sep 28, 2020

According to https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_reqs_bestpractices.html I should be able to have Autoscaling and Global tables.

If I set replicationRegions I get the error "AutoScaling is not available for tables with PAY_PER_REQUEST billing mode", when I do autoScaleReadCapacity. This is because table's constructor sets PAY_PER_REQUEST when I pass replicationRegions.

As it stands I have no way of declaring global tables with autoscaling.

AFAIK what we want to avoid is global tables with provisioning and without autoscaling, so we should test for that on the add global replication tables method and make it public instead of calling it from the constructor.

@rjcoelho rjcoelho added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 28, 2020
@github-actions github-actions bot added the @aws-cdk/aws-dynamodb Related to Amazon DynamoDB label Sep 28, 2020
@skinny85 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 Oct 15, 2020
@pathik9
Copy link

pathik9 commented Nov 19, 2020

Probably related with: #11346

@jumic
Copy link
Contributor

jumic commented Aug 15, 2021

@rjcoelho When I understand your problem correctly, it is the same requirement as requested in #11346. This was resolved by PR #12159. Or is there something missing?

You can specify a global table with provisioning and use autoscaling, now. See this example.

const globalTable = new dynamodb.Table(this, 'Table', {
  partitionKey: { name: 'id', type: dynamodb.AttributeType.STRING },
  replicationRegions: ['us-east-1'],
  billingMode: dynamodb.BillingMode.PROVISIONED,    
});
globalTable.autoScaleReadCapacity({
  maxCapacity: 10,
  minCapacity: 5,
}).scaleOnUtilization({
  targetUtilizationPercent: 90,
});
globalTable.autoScaleWriteCapacity({
  maxCapacity: 10,
  minCapacity: 5,
}).scaleOnUtilization({
  targetUtilizationPercent: 90,
});

@peterwoodworth Maybe a candidate for "closing soon".

@peterwoodworth
Copy link
Contributor

Yes, this was resolved by PR #12159 so no need to keep this open

@github-actions
Copy link

⚠️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 bug This issue is a bug. effort/medium Medium work item – several days of effort p1
Projects
None yet
Development

No branches or pull requests

5 participants