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

DynamoDbException ReadCapacityUnits and WriteCapacityUnits must both be specified when BillingMode is PROVISIONED #1357

Open
vsadokhin opened this issue Jul 2, 2024 · 0 comments

Comments

@vsadokhin
Copy link

Hello!

We try to configure the client to create DynamoDB table with PROVISIONED billing mode like this:

LeaseManagementConfig leaseManagementConfig = configsBuilder.leaseManagementConfig();
leaseManagementConfig.billingMode(BillingMode.PROVISIONED);
leaseManagementConfig.initialLeaseTableReadCapacity(5);
leaseManagementConfig.initialLeaseTableWriteCapacity(10);
leaseManagementConfig.initialPositionInStream(InitialPositionInStream.LATEST);
leaseManagementConfig.streamName("someStreamName");

but it fails to create a table:

software.amazon.kinesis.leases.exceptions.DependencyException: software.amazon.awssdk.services.dynamodb.model.DynamoDbException: One or more parameter values were invalid: ReadCapacityUnits and WriteCapacityUnits must both be specified when BillingMode is PROVISIONED (Service: DynamoDb, Status Code: 400, Request ID: <SOME_ID>)
    at software.amazon.kinesis.leases.dynamodb.DynamoDBLeaseRefresher.createTableIfNotExists(DynamoDBLeaseRefresher.java:247)
    at software.amazon.kinesis.leases.dynamodb.DynamoDBLeaseRefresher.createLeaseTableIfNotExists(DynamoDBLeaseRefresher.java:212)
    at software.amazon.kinesis.leases.dynamodb.DynamoDBLeaseCoordinator.initialize(DynamoDBLeaseCoordinator.java:260)
    at software.amazon.kinesis.coordinator.Scheduler.initialize(Scheduler.java:356)
    at software.amazon.kinesis.coordinator.Scheduler.run(Scheduler.java:330)

Looking at source code it seems that createLeaseTableIfNotExists() method does not respect initialLeaseTableReadCapacity and initialLeaseTableWriteCapacity provided nor specify readCapacityUnits / writeCapacityUnits based on anything else. There is also a deprecated method with signature createLeaseTableIfNotExists(@NonNull final Long readCapacity, @NonNull final Long writeCapacity) but it looks like it is not used anymore.

amazon-kinesis-client version 2.5.8

Do we configure it wrong way? Or is it a bug in the client?

Regards,
Vasiliy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant