Skip to main content

Defined in: src/idempotency-table/idempotency-table.ts:26

Properties for configuring an IdempotencyTable construct.

This interface extends DynamoDB TableProps but excludes properties that are mandatory for AWS Lambda Powertools idempotency functionality. The following properties are automatically set and cannot be overridden:

  • partitionKey: Fixed to 'id' (STRING type)
  • timeToLiveAttribute: Fixed to 'expiration'
  • sortKey: Not allowed (idempotency tables use simple primary key)

Example

const idempotencyTable = new IdempotencyTable(this, 'MyIdempotencyTable', {
tableName: 'my-idempotency-table',
removalPolicy: RemovalPolicy.DESTROY,
readCapacity: 5,
writeCapacity: 5,
});

Extends

  • Omit<dynamodb.TableProps, "partitionKey" | "sortKey" | "timeToLiveAttribute">

Properties

billingMode?

readonly optional billingMode: BillingMode

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:194

Specify how you are charged for read and write throughput and how you manage capacity.

Default

PROVISIONED if replicationRegions is not specified, PAY_PER_REQUEST otherwise

Inherited from

Omit.billingMode


contributorInsightsEnabled?

readonly optional contributorInsightsEnabled: boolean

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:310

Whether CloudWatch contributor insights is enabled.

Deprecated

use `contributorInsightsSpecification instead

Default

false

Inherited from

Omit.contributorInsightsEnabled


contributorInsightsSpecification?

readonly optional contributorInsightsSpecification: ContributorInsightsSpecification

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:315

Whether CloudWatch contributor insights is enabled and what mode is selected

Default

- contributor insights is not enabled

Inherited from

Omit.contributorInsightsSpecification


deletionProtection?

readonly optional deletionProtection: boolean

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:321

Enables deletion protection for the table.

Default

false

Inherited from

Omit.deletionProtection


encryption?

readonly optional encryption: TableEncryption

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:234

Whether server-side encryption with an AWS managed customer master key is enabled.

This property cannot be set if serverSideEncryption is set.

NOTE: if you set this to CUSTOMER_MANAGED and encryptionKey is not specified, the key that the Tablet generates for you will be created with default permissions. If you are using CDKv2, these permissions will be sufficient to enable the key for use with DynamoDB tables. If you are using CDKv1, make sure the feature flag @aws-cdk/aws-kms:defaultKeyPolicies is set to true in your cdk.json.

Default

- The table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.

Inherited from

Omit.encryption


encryptionKey?

readonly optional encryptionKey: IKey

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:245

External KMS key to use for table encryption.

This property can only be set if encryption is set to TableEncryption.CUSTOMER_MANAGED.

Default

  • If encryption is set to TableEncryption.CUSTOMER_MANAGED and this property is undefined, a new KMS key will be created and associated with this table. If encryption and this property are both undefined, then the table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.

Inherited from

Omit.encryptionKey


importSource?

readonly optional importSource: ImportSourceSpecification

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:327

The properties of data being imported from the S3 bucket source to the table.

Default

- no data import from the S3 bucket

Inherited from

Omit.importSource


kinesisPrecisionTimestamp?

readonly optional kinesisPrecisionTimestamp: ApproximateCreationDateTimePrecision

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:355

Kinesis Data Stream approximate creation timestamp precision

Default

ApproximateCreationDateTimePrecision.MICROSECOND

Inherited from

Omit.kinesisPrecisionTimestamp


kinesisStream?

readonly optional kinesisStream: IStream

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:349

Kinesis Data Stream to capture item-level changes for the table.

Default

- no Kinesis Data Stream

Inherited from

Omit.kinesisStream


maxReadRequestUnits?

readonly optional maxReadRequestUnits: number

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:179

The maximum read request units for the table. Careful if you add Global Secondary Indexes, as those will share the table's maximum on-demand throughput.

Can only be provided if billingMode is PAY_PER_REQUEST.

Default

- on-demand throughput is disabled

Inherited from

Omit.maxReadRequestUnits


maxWriteRequestUnits?

readonly optional maxWriteRequestUnits: number

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:188

The write request units for the table. Careful if you add Global Secondary Indexes, as those will share the table's maximum on-demand throughput.

Can only be provided if billingMode is PAY_PER_REQUEST.

Default

- on-demand throughput is disabled

Inherited from

Omit.maxWriteRequestUnits


pointInTimeRecovery?

readonly optional pointInTimeRecovery: boolean

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:207

Whether point-in-time recovery is enabled.

Deprecated

use pointInTimeRecoverySpecification instead

Default

false - point in time recovery is not enabled.

Inherited from

Omit.pointInTimeRecovery


pointInTimeRecoverySpecification?

readonly optional pointInTimeRecoverySpecification: PointInTimeRecoverySpecification

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:214

Whether point-in-time recovery is enabled and recoveryPeriodInDays is set.

Default

- point in time recovery is not enabled.

Inherited from

Omit.pointInTimeRecoverySpecification


readCapacity?

readonly optional readCapacity: number

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:161

The read capacity for the table. Careful if you add Global Secondary Indexes, as those will share the table's provisioned throughput.

Can only be provided if billingMode is Provisioned.

Default

5

Inherited from

Omit.readCapacity


removalPolicy?

readonly optional removalPolicy: RemovalPolicy

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:263

The removal policy to apply to the DynamoDB Table.

Default

RemovalPolicy.RETAIN

Inherited from

Omit.removalPolicy


replicaRemovalPolicy?

readonly optional replicaRemovalPolicy: RemovalPolicy

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:269

The removal policy to apply to the DynamoDB replica tables.

Default

undefined - use DynamoDB Table's removal policy

Inherited from

Omit.replicaRemovalPolicy


replicationRegions?

readonly optional replicationRegions: string[]

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:275

Regions where replica tables will be created

Default

- no replica tables are created

Inherited from

Omit.replicationRegions


replicationTimeout?

readonly optional replicationTimeout: Duration

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:281

The timeout for a table replication operation in a single region.

Default

Duration.minutes(30)

Inherited from

Omit.replicationTimeout


resourcePolicy?

readonly optional resourcePolicy: PolicyDocument

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:333

Resource policy to assign to table.

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-resourcepolicy

Default

- No resource policy statement

Inherited from

Omit.resourcePolicy


stream?

readonly optional stream: StreamViewType

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:257

When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.

Default

  • streams are disabled unless replicationRegions is specified

Inherited from

Omit.stream


tableClass?

readonly optional tableClass: TableClass

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:219

Specify the table class.

Default

STANDARD

Inherited from

Omit.tableClass


tableName?

readonly optional tableName: string

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:343

Enforces a particular physical table name.

Default

<generated>

Inherited from

Omit.tableName


waitForReplicationToFinish?

readonly optional waitForReplicationToFinish: boolean

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:304

[WARNING: Use this flag with caution, misusing this flag may cause deleting existing replicas, refer to the detailed documentation for more information] Indicates whether CloudFormation stack waits for replication to finish. If set to false, the CloudFormation resource will mark the resource as created and replication will be completed asynchronously. This property is ignored if replicationRegions property is not set.

WARNING: DO NOT UNSET this property if adding/removing multiple replicationRegions in one deployment, as CloudFormation only supports one region replication at a time. CDK overcomes this limitation by waiting for replication to finish before starting new replicationRegion.

If the custom resource which handles replication has a physical resource ID with the format region instead of tablename-region (this would happen if the custom resource hasn't received an event since v1.91.0), DO NOT SET this property to false without making a change to the table name. This will cause the existing replicas to be deleted.

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-replicas

Default

true

Inherited from

Omit.waitForReplicationToFinish


warmThroughput?

readonly optional warmThroughput: WarmThroughput

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:201

Specify values to pre-warm you DynamoDB Table Warm Throughput feature is not available for Global Table replicas using the Table construct. To enable Warm Throughput, use the TableV2 construct instead.

See

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-warmthroughput

Default

- warm throughput is not configured

Inherited from

Omit.warmThroughput


writeCapacity?

readonly optional writeCapacity: number

Defined in: node_modules/.pnpm/aws-cdk-lib@2.214.0_constructs@10.4.2/node_modules/aws-cdk-lib/aws-dynamodb/lib/table.d.ts:170

The write capacity for the table. Careful if you add Global Secondary Indexes, as those will share the table's provisioned throughput.

Can only be provided if billingMode is Provisioned.

Default

5

Inherited from

Omit.writeCapacity