A DynamoDB Table.
import { TableV2 } from 'aws-cdk-lib/aws-dynamodb';Or use the module namespace:
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
// dynamodb.TableV2Configuration passed to the constructor as TablePropsV2.
partitionKeyRequiredAttributePartition key attribute definition.
billingOptionalBillingThe billing mode and capacity settings to apply to the table.
Default: Billing.onDemand()
dynamoStreamOptionalStreamViewTypeWhen an item in the table is modified, StreamViewType determines what information is written to the stream.
Default: - streams are disabled if replicas are not configured and this property is
not specified. If this property is not specified when replicas are configured, then
NEW_AND_OLD_IMAGES will be the StreamViewType for all replicas
encryptionOptionalTableEncryptionV2The server-side encryption.
Default: TableEncryptionV2.dynamoOwnedKey()
globalSecondaryIndexesOptionalGlobalSecondaryIndexPropsV2[]Global secondary indexes. Note: You can provide a maximum of 20 global secondary indexes.
Default: - no global secondary indexes
globalTableSettingsReplicationModeOptionalGlobalTableSettingsReplicationModeControls whether table settings are synchronized across replicas. When set to ALL, synchronizable settings (billing mode, throughput, TTL, streams view type, GSIs) are automatically replicated across all replicas. When set to NONE, each replica manages its own settings independently (billing mode must be PAY_PER_REQUEST). Note: Some settings are always synchronized (key schema, LSIs) regardless of this setting, and some are never synchronized (table class, SSE, deletion protection, PITR, tags, resource policy).
Default: GlobalTableSettingsReplicationMode.NONE
localSecondaryIndexesOptionalLocalSecondaryIndexProps[]Local secondary indexes. Note: You can only provide a maximum of 5 local secondary indexes.
Default: - no local secondary indexes
multiRegionConsistencyOptionalMultiRegionConsistencySpecifies the consistency mode for a new global table.
Default: MultiRegionConsistency.EVENTUAL
removalPolicyOptionalRemovalPolicyThe removal policy applied to the table.
Default: RemovalPolicy.RETAIN
replicasOptionalReplicaTableProps[]Replica tables to deploy with the primary table. Note: Adding replica tables allows you to use your table as a global table. You cannot specify a replica table in the region that the primary table will be deployed to. Replica tables will only be supported if the stack deployment region is defined.
Default: - no replica tables
sortKeyOptionalAttributeSort key attribute definition.
Default: - no sort key
tableNameOptionalstringThe name of the table.
Default: - generated by CloudFormation
timeToLiveAttributeOptionalstringThe name of the TTL attribute.
Default: - TTL is disabled
warmThroughputOptionalWarmThroughputThe warm throughput configuration for the table.
Default: - no warm throughput is configured
witnessRegionOptionalstringThe witness Region for the MRSC global table. A MRSC global table can be configured with either three replicas, or with two replicas and one witness. Note: Witness region cannot be specified for a Multi-Region Eventual Consistency (MREC) Global Table. Witness regions are only supported for Multi-Region Strong Consistency (MRSC) Global Tables.
Default: - no witness region
TableOptionsV2contributorInsightsOptionalDeprecatedinherited from TableOptionsV2booleanWhether CloudWatch contributor insights is enabled.
Default: false
Deprecated: use `contributorInsightsSpecification` instead
contributorInsightsSpecificationOptionalinherited from TableOptionsV2ContributorInsightsSpecificationWhether CloudWatch contributor insights is enabled and what mode is selected.
Default: - contributor insights is not enabled
deletionProtectionOptionalinherited from TableOptionsV2booleanWhether deletion protection is enabled.
Default: false
kinesisStreamOptionalinherited from TableOptionsV2IStreamKinesis Data Stream to capture item level changes.
Default: - no Kinesis Data Stream
pointInTimeRecoveryOptionalDeprecatedinherited from TableOptionsV2booleanWhether point-in-time recovery is enabled.
Default: false - point in time recovery is not enabled.
Deprecated: use `pointInTimeRecoverySpecification` instead
pointInTimeRecoverySpecificationOptionalinherited from TableOptionsV2PointInTimeRecoverySpecificationWhether point-in-time recovery is enabled and recoveryPeriodInDays is set.
Default: - point in time recovery is not enabled.
resourcePolicyOptionalinherited from TableOptionsV2PolicyDocumentResource policy to assign to DynamoDB Table.
Default: - No resource policy statements are added to the created table.
tableClassOptionalinherited from TableOptionsV2TableClassThe table class.
Default: TableClass.STANDARD
tagsOptionalinherited from TableOptionsV2CfnTag[]Tags to be applied to the primary table (default replica table).
Default: - no tags
Everything you need to know about Amazon DynamoDB on one page. HD quality, print-friendly.
Download Free Infographicaws-dynamodb