Interface TablePropsV2

All Superinterfaces:
software.amazon.jsii.JsiiSerializable, TableOptionsV2
All Known Implementing Classes:
TablePropsV2.Jsii$Proxy

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-04-02T21:55:08.847Z") @Stability(Stable) public interface TablePropsV2 extends software.amazon.jsii.JsiiSerializable, TableOptionsV2
Properties used to configure a DynamoDB table.

Example:

 import software.amazon.awscdk.*;
 App app = new App();
 Stack stack = Stack.Builder.create(app, "Stack").env(Environment.builder().region("us-west-2").build()).build();
 TableV2 mrscTable = TableV2.Builder.create(stack, "MRSCTable")
         .partitionKey(Attribute.builder().name("pk").type(AttributeType.STRING).build())
         .multiRegionConsistency(MultiRegionConsistency.STRONG)
         .replicas(List.of(ReplicaTableProps.builder().region("us-east-1").build(), ReplicaTableProps.builder().region("us-east-2").build()))
         .build();
 
  • Method Details

    • getPartitionKey

      @Stability(Stable) @NotNull Attribute getPartitionKey()
      Partition key attribute definition.
    • getBilling

      @Stability(Stable) @Nullable default Billing getBilling()
      The billing mode and capacity settings to apply to the table.

      Default: Billing.onDemand()

    • getDynamoStream

      @Stability(Stable) @Nullable default StreamViewType getDynamoStream()
      When 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

    • getEncryption

      @Stability(Stable) @Nullable default TableEncryptionV2 getEncryption()
      The server-side encryption.

      Default: TableEncryptionV2.dynamoOwnedKey()

    • getGlobalSecondaryIndexes

      @Stability(Stable) @Nullable default List<GlobalSecondaryIndexPropsV2> getGlobalSecondaryIndexes()
      Global secondary indexes.

      Note: You can provide a maximum of 20 global secondary indexes.

      Default: - no global secondary indexes

    • getGlobalTableSettingsReplicationMode

      @Stability(Stable) @Nullable default GlobalTableSettingsReplicationMode getGlobalTableSettingsReplicationMode()
      Controls 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

    • getLocalSecondaryIndexes

      @Stability(Stable) @Nullable default List<LocalSecondaryIndexProps> getLocalSecondaryIndexes()
      Local secondary indexes.

      Note: You can only provide a maximum of 5 local secondary indexes.

      Default: - no local secondary indexes

    • getMultiRegionConsistency

      @Stability(Stable) @Nullable default MultiRegionConsistency getMultiRegionConsistency()
      Specifies the consistency mode for a new global table.

      Default: MultiRegionConsistency.EVENTUAL

    • getRemovalPolicy

      @Stability(Stable) @Nullable default RemovalPolicy getRemovalPolicy()
      The removal policy applied to the table.

      Default: RemovalPolicy.RETAIN

    • getReplicas

      @Stability(Stable) @Nullable default List<ReplicaTableProps> getReplicas()
      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

    • getSortKey

      @Stability(Stable) @Nullable default Attribute getSortKey()
      Sort key attribute definition.

      Default: - no sort key

    • getTableName

      @Stability(Stable) @Nullable default String getTableName()
      The name of the table.

      Default: - generated by CloudFormation

    • getTimeToLiveAttribute

      @Stability(Stable) @Nullable default String getTimeToLiveAttribute()
      The name of the TTL attribute.

      Default: - TTL is disabled

    • getWarmThroughput

      @Stability(Stable) @Nullable default WarmThroughput getWarmThroughput()
      The warm throughput configuration for the table.

      Default: - no warm throughput is configured

    • getWitnessRegion

      @Stability(Stable) @Nullable default String getWitnessRegion()
      The 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

    • builder

      @Stability(Stable) static TablePropsV2.Builder builder()
      Returns:
      a TablePropsV2.Builder of TablePropsV2