# TableOptionsV2

Options used to configure a DynamoDB table.

- Source: [`aws-dynamodb/lib/table-v2.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-dynamodb/lib/table-v2.ts#L229)
- Type last changed: v2.254.0 · 13 May 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_dynamodb as dynamodb } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kinesis as kinesis } from 'aws-cdk-lib';

declare const policyDocument: iam.PolicyDocument;
declare const stream: kinesis.Stream;
const tableOptionsV2: dynamodb.TableOptionsV2 = {
  contributorInsights: false,
  contributorInsightsSpecification: {
    enabled: false,

    // the properties below are optional
    mode: dynamodb.ContributorInsightsMode.ACCESSED_AND_THROTTLED_KEYS,
  },
  deletionProtection: false,
  kinesisStream: stream,
  pointInTimeRecovery: false,
  pointInTimeRecoverySpecification: {
    pointInTimeRecoveryEnabled: false,

    // the properties below are optional
    recoveryPeriodInDays: 123,
  },
  resourcePolicy: policyDocument,
  streamResourcePolicy: policyDocument,
  tableClass: dynamodb.TableClass.STANDARD,
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

## Properties

- `contributorInsights`: boolean = false — use `contributorInsightsSpecification` instead

- `contributorInsightsSpecification`: [ContributorInsightsSpecification](/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.ContributorInsightsSpecification.html) — Whether CloudWatch contributor insights is enabled and what mode is selected.

  **Default:** contributor insights is not enabled

- `deletionProtection`: boolean = false — Whether deletion protection is enabled.

- `kinesisStream`: [IStream](/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.IStream.html) — Kinesis Data Stream to capture item level changes.

  **Default:** no Kinesis Data Stream

- `pointInTimeRecovery`: boolean — use `pointInTimeRecoverySpecification` instead

  **Default:** false - point in time recovery is not enabled.

- `pointInTimeRecoverySpecification`: [PointInTimeRecoverySpecification](/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.PointInTimeRecoverySpecification.html) — Whether point-in-time recovery is enabled and recoveryPeriodInDays is set.

  **Default:** point in time recovery is not enabled.

- `resourcePolicy`: [PolicyDocument](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.PolicyDocument.html) — Resource policy to assign to DynamoDB Table.

  **Default:** No resource policy statements are added to the created table.

- `streamResourcePolicy`: [PolicyDocument](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.PolicyDocument.html) — Resource policy to assign to DynamoDB Stream.

  **Default:** No resource policy statements are added to the stream.

- `tableClass`: [TableClass](/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.TableClass.html) = TableClass.STANDARD — The table class.

- `tags`: [CfnTag](/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — Tags to be applied to the primary table (default replica table).

  **Default:** no tags
