class Capacity
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.DynamoDB.Capacity |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsdynamodb#Capacity |
Java | software.amazon.awscdk.services.dynamodb.Capacity |
Python | aws_cdk.aws_dynamodb.Capacity |
TypeScript (source) | aws-cdk-lib » aws_dynamodb » Capacity |
Represents the amount of read and write operations supported by a DynamoDB table.
Example
import * as cdk from 'aws-cdk-lib';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'Stack', { env: { region: 'us-west-2' } });
const globalTable = new dynamodb.TableV2(stack, 'GlobalTable', {
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
billing: dynamodb.Billing.provisioned({
readCapacity: dynamodb.Capacity.fixed(10),
writeCapacity: dynamodb.Capacity.autoscaled({ maxCapacity: 15 }),
}),
replicas: [
{
region: 'us-east-1',
},
{
region: 'us-east-2',
readCapacity: dynamodb.Capacity.autoscaled({ maxCapacity: 20, targetUtilizationPercent: 50 }),
},
],
});
Properties
Name | Type | Description |
---|---|---|
mode | Capacity |
mode
Type:
Capacity
Methods
Name | Description |
---|---|
static autoscaled(options) | Dynamically adjusts provisioned throughput capacity on your behalf in response to actual traffic patterns. |
static fixed(iops) | Provisioned throughput capacity is configured with fixed capacity units. |
static autoscaled(options)
public static autoscaled(options: AutoscaledCapacityOptions): Capacity
Parameters
- options
Autoscaled
— options used to configure autoscaled capacity mode.Capacity Options
Returns
Dynamically adjusts provisioned throughput capacity on your behalf in response to actual traffic patterns.
static fixed(iops)
public static fixed(iops: number): Capacity
Parameters
- iops
number
— the number of I/O operations per second.
Returns
Provisioned throughput capacity is configured with fixed capacity units.
Note: You cannot configure write capacity using fixed capacity mode.