Skip to content
v2.275.0

Capacity Class ​

Represents the amount of read and write operations supported by a DynamoDB table.

Example ​

ts
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 ​

Methods ​

autoscaled(options: AutoscaledCapacityOptions): Capacity // chainable@staticmethod def autoscaled(options: AutoscaledCapacityOptions) -> Capacitypublic static Capacity autoscaled(AutoscaledCapacityOptions options)public static Capacity Autoscaled(AutoscaledCapacityOptions options)func Autoscaled(Options AutoscaledCapacityOptions) Capacitystatic#
Dynamically adjusts provisioned throughput capacity on your behalf in response to actual traffic patterns.
1 parameter

Parameters

  • optionsoptionsoptionsoptionsOptions — options used to configure autoscaled capacity mode.
fixed(iops: number): Capacity // chainable@staticmethod def fixed(iops: int | float) -> Capacitypublic static Capacity fixed(Number iops)public static Capacity Fixed(double iops)func Fixed(Iops *float64) Capacitystatic#
Provisioned throughput capacity is configured with fixed capacity units.

Note: You cannot configure write capacity using fixed capacity mode.

1 parameter

Parameters

  • iopsiopsiopsiopsIops — the number of I/O operations per second.