Skip to content
v2.274.0

AutoscaledCapacityOptions Struct ​

Options used to configure autoscaled capacity.

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 ​

maxCapacitynumbermax_capacityint | floatmaxCapacityNumberMaxCapacitydoubleMaxCapacity*float64required#
The maximum allowable capacity.
minCapacitynumbermin_capacityint | floatminCapacityNumberMinCapacitydoubleMinCapacity*float64= 1#
The minimum allowable capacity.
seedCapacitynumberseed_capacityint | floatseedCapacityNumberSeedCapacitydoubleSeedCapacity*float64#
If you want to switch a table's billing mode from on-demand to provisioned or from provisioned to on-demand, you must specify a value for this property for each autoscaled resource.

Default: no seed capacity

targetUtilizationPercentnumbertarget_utilization_percentint | floattargetUtilizationPercentNumberTargetUtilizationPercentdoubleTargetUtilizationPercent*float64= 70#
The ratio of consumed capacity units to provisioned capacity units.

Note: Target utilization percent cannot be less than 20 and cannot be greater than 90.