Interface TablePropsV2

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

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:00.072Z") @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 globalTable = TableV2.Builder.create(stack, "GlobalTable")
         .partitionKey(Attribute.builder().name("pk").type(AttributeType.STRING).build())
         // applys to all replicas, i.e., us-west-2, us-east-1, us-east-2
         .removalPolicy(RemovalPolicy.DESTROY)
         .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

    • 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

    • 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

    • builder

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