# Capacity

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

- Source: [`aws-dynamodb/lib/capacity.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-dynamodb/lib/capacity.ts#L59)
- Type last changed: v2.95.0 · 7 Sep 2023

## 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

- `mode`: [CapacityMode](/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.CapacityMode.html)

## Methods

- `autoscaled(options: AutoscaledCapacityOptions): Capacity // chainable` (static) — Dynamically adjusts provisioned throughput capacity on your behalf in response to actual traffic patterns.

  **Parameters**

  - `options` — options used to configure autoscaled capacity mode.

- `fixed(iops: number): Capacity // chainable` (static) — Provisioned throughput capacity is configured with fixed capacity units.

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

  **Parameters**

  - `iops` — the number of I/O operations per second.
