TablePropsV2 Struct
Properties used to configure a DynamoDB table.
Example
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 mrscTable = new dynamodb.TableV2(stack, 'MRSCTable', {
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
multiRegionConsistency: dynamodb.MultiRegionConsistency.STRONG,
replicas: [
{ region: 'us-east-1' },
],
witnessRegion: 'us-east-2',
});
Properties
contributorInsightsbooleancontributor_insightsboolcontributorInsightsBooleanContributorInsightsboolContributorInsights*bool= falsedeprecated#contributorInsightsSpecificationContributorInsightsSpecificationcontributor_insights_specificationContributorInsightsSpecificationcontributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecification= contributor insights is not enab…#default
Default: contributor insights is not enabled
deletionProtectionbooleandeletion_protectionbooldeletionProtectionBooleanDeletionProtectionboolDeletionProtection*bool= false#dynamoStreamStreamViewTypedynamo_streamStreamViewTypedynamoStreamStreamViewTypeDynamoStreamStreamViewTypeDynamoStreamStreamViewType= streams are disabled if replicas…#default
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
encryptionTableEncryptionV2encryptionTableEncryptionV2encryptionTableEncryptionV2EncryptionTableEncryptionV2EncryptionTableEncryptionV2= TableEncryptionV2.dynamoOwnedKey…#default
Default: TableEncryptionV2.dynamoOwnedKey()
globalSecondaryIndexesGlobalSecondaryIndexPropsV2[]global_secondary_indexestyping.List[GlobalSecondaryIndexPropsV2]globalSecondaryIndexesList<GlobalSecondaryIndexPropsV2>GlobalSecondaryIndexesGlobalSecondaryIndexPropsV2[]GlobalSecondaryIndexes*[]GlobalSecondaryIndexPropsV2= no global secondary indexes#Note: You can provide a maximum of 20 global secondary indexes.
globalTableSettingsReplicationModeGlobalTableSettingsReplicationModeglobal_table_settings_replication_modeGlobalTableSettingsReplicationModeglobalTableSettingsReplicationModeGlobalTableSettingsReplicationModeGlobalTableSettingsReplicationModeGlobalTableSettingsReplicationModeGlobalTableSettingsReplicationModeGlobalTableSettingsReplicationMode= GlobalTableSettingsReplicationMo…#notes · default
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
kinesisStreamIStreamkinesis_streamIStreamkinesisStreamIStreamKinesisStreamIStreamKinesisStreamIStream= no Kinesis Data Stream#localSecondaryIndexesLocalSecondaryIndexProps[]local_secondary_indexestyping.List[LocalSecondaryIndexProps]localSecondaryIndexesList<LocalSecondaryIndexProps>LocalSecondaryIndexesLocalSecondaryIndexProps[]LocalSecondaryIndexes*[]LocalSecondaryIndexProps= no local secondary indexes#Note: You can only provide a maximum of 5 local secondary indexes.
multiRegionConsistencyMultiRegionConsistencymulti_region_consistencyMultiRegionConsistencymultiRegionConsistencyMultiRegionConsistencyMultiRegionConsistencyMultiRegionConsistencyMultiRegionConsistencyMultiRegionConsistency= MultiRegionConsistency.EVENTUAL#partitionKeyAttributepartition_keyAttributepartitionKeyAttributePartitionKeyAttributePartitionKeyAttributerequired#pointInTimeRecoverybooleanpoint_in_time_recoveryboolpointInTimeRecoveryBooleanPointInTimeRecoveryboolPointInTimeRecovery*bool= false - point in time recovery i…deprecated#default
Default: false - point in time recovery is not enabled.
pointInTimeRecoverySpecificationPointInTimeRecoverySpecificationpoint_in_time_recovery_specificationPointInTimeRecoverySpecificationpointInTimeRecoverySpecificationPointInTimeRecoverySpecificationPointInTimeRecoverySpecificationPointInTimeRecoverySpecificationPointInTimeRecoverySpecificationPointInTimeRecoverySpecification= point in time recovery is not en…#default
Default: point in time recovery is not enabled.
removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.RETAIN#replicasReplicaTableProps[]replicastyping.List[ReplicaTableProps]replicasList<ReplicaTableProps>ReplicasReplicaTableProps[]Replicas*[]ReplicaTableProps= no replica tables#notes
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.
resourcePolicyPolicyDocumentresource_policyPolicyDocumentresourcePolicyPolicyDocumentResourcePolicyPolicyDocumentResourcePolicyPolicyDocument= No resource policy statements ar…#default
Default: No resource policy statements are added to the created table.
streamResourcePolicyPolicyDocumentstream_resource_policyPolicyDocumentstreamResourcePolicyPolicyDocumentStreamResourcePolicyPolicyDocumentStreamResourcePolicyPolicyDocument= No resource policy statements ar…#default
Default: No resource policy statements are added to the stream.
tableClassTableClasstable_classTableClasstableClassTableClassTableClassTableClassTableClassTableClass= TableClass.STANDARD#tableNamestringtable_namestrtableNameStringTableNamestringTableName*string= generated by CloudFormation#timeToLiveAttributestringtime_to_live_attributestrtimeToLiveAttributeStringTimeToLiveAttributestringTimeToLiveAttribute*string= TTL is disabled#warmThroughputWarmThroughputwarm_throughputWarmThroughputwarmThroughputWarmThroughputWarmThroughputWarmThroughputWarmThroughputWarmThroughput= no warm throughput is configured#witnessRegionstringwitness_regionstrwitnessRegionStringWitnessRegionstringWitnessRegion*string= no witness region#notes
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.