Class TableV2.Builder

java.lang.Object
software.amazon.awscdk.services.dynamodb.TableV2.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<TableV2>
Enclosing class:
TableV2

@Stability(Stable) public static final class TableV2.Builder extends Object implements software.amazon.jsii.Builder<TableV2>
A fluent builder for TableV2.
  • Method Details

    • create

      @Stability(Stable) public static TableV2.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of TableV2.Builder.
    • contributorInsights

      @Stability(Stable) public TableV2.Builder contributorInsights(Boolean contributorInsights)
      Whether CloudWatch contributor insights is enabled.

      Default: false

      Parameters:
      contributorInsights - Whether CloudWatch contributor insights is enabled. This parameter is required.
      Returns:
      this
    • deletionProtection

      @Stability(Stable) public TableV2.Builder deletionProtection(Boolean deletionProtection)
      Whether deletion protection is enabled.

      Default: false

      Parameters:
      deletionProtection - Whether deletion protection is enabled. This parameter is required.
      Returns:
      this
    • kinesisStream

      @Stability(Stable) public TableV2.Builder kinesisStream(IStream kinesisStream)
      Kinesis Data Stream to capture item level changes.

      Default: - no Kinesis Data Stream

      Parameters:
      kinesisStream - Kinesis Data Stream to capture item level changes. This parameter is required.
      Returns:
      this
    • pointInTimeRecovery

      @Stability(Stable) public TableV2.Builder pointInTimeRecovery(Boolean pointInTimeRecovery)
      Whether point-in-time recovery is enabled.

      Default: false

      Parameters:
      pointInTimeRecovery - Whether point-in-time recovery is enabled. This parameter is required.
      Returns:
      this
    • resourcePolicy

      @Stability(Stable) public TableV2.Builder resourcePolicy(PolicyDocument resourcePolicy)
      Resource policy to assign to DynamoDB Table.

      Default: - No resource policy statements are added to the created table.

      Parameters:
      resourcePolicy - Resource policy to assign to DynamoDB Table. This parameter is required.
      Returns:
      this
      See Also:
    • tableClass

      @Stability(Stable) public TableV2.Builder tableClass(TableClass tableClass)
      The table class.

      Default: TableClass.STANDARD

      Parameters:
      tableClass - The table class. This parameter is required.
      Returns:
      this
    • tags

      @Stability(Stable) public TableV2.Builder tags(List<? extends CfnTag> tags)
      Tags to be applied to the table or replica table.

      Default: - no tags

      Parameters:
      tags - Tags to be applied to the table or replica table. This parameter is required.
      Returns:
      this
    • partitionKey

      @Stability(Stable) public TableV2.Builder partitionKey(Attribute partitionKey)
      Partition key attribute definition.

      Parameters:
      partitionKey - Partition key attribute definition. This parameter is required.
      Returns:
      this
    • billing

      @Stability(Stable) public TableV2.Builder billing(Billing billing)
      The billing mode and capacity settings to apply to the table.

      Default: Billing.onDemand()

      Parameters:
      billing - The billing mode and capacity settings to apply to the table. This parameter is required.
      Returns:
      this
    • dynamoStream

      @Stability(Stable) public TableV2.Builder dynamoStream(StreamViewType dynamoStream)
      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

      Parameters:
      dynamoStream - When an item in the table is modified, StreamViewType determines what information is written to the stream. This parameter is required.
      Returns:
      this
    • encryption

      @Stability(Stable) public TableV2.Builder encryption(TableEncryptionV2 encryption)
      The server-side encryption.

      Default: TableEncryptionV2.dynamoOwnedKey()

      Parameters:
      encryption - The server-side encryption. This parameter is required.
      Returns:
      this
    • globalSecondaryIndexes

      @Stability(Stable) public TableV2.Builder globalSecondaryIndexes(List<? extends GlobalSecondaryIndexPropsV2> globalSecondaryIndexes)
      Global secondary indexes.

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

      Default: - no global secondary indexes

      Parameters:
      globalSecondaryIndexes - Global secondary indexes. This parameter is required.
      Returns:
      this
    • localSecondaryIndexes

      @Stability(Stable) public TableV2.Builder localSecondaryIndexes(List<? extends LocalSecondaryIndexProps> localSecondaryIndexes)
      Local secondary indexes.

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

      Default: - no local secondary indexes

      Parameters:
      localSecondaryIndexes - Local secondary indexes. This parameter is required.
      Returns:
      this
    • removalPolicy

      @Stability(Stable) public TableV2.Builder removalPolicy(RemovalPolicy removalPolicy)
      The removal policy applied to the table.

      Default: RemovalPolicy.RETAIN

      Parameters:
      removalPolicy - The removal policy applied to the table. This parameter is required.
      Returns:
      this
    • replicas

      @Stability(Stable) public TableV2.Builder replicas(List<? extends ReplicaTableProps> replicas)
      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

      Parameters:
      replicas - Replica tables to deploy with the primary table. This parameter is required.
      Returns:
      this
    • sortKey

      @Stability(Stable) public TableV2.Builder sortKey(Attribute sortKey)
      Sort key attribute definition.

      Default: - no sort key

      Parameters:
      sortKey - Sort key attribute definition. This parameter is required.
      Returns:
      this
    • tableName

      @Stability(Stable) public TableV2.Builder tableName(String tableName)
      The name of the table.

      Default: - generated by CloudFormation

      Parameters:
      tableName - The name of the table. This parameter is required.
      Returns:
      this
    • timeToLiveAttribute

      @Stability(Stable) public TableV2.Builder timeToLiveAttribute(String timeToLiveAttribute)
      The name of the TTL attribute.

      Default: - TTL is disabled

      Parameters:
      timeToLiveAttribute - The name of the TTL attribute. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public TableV2 build()
      Specified by:
      build in interface software.amazon.jsii.Builder<TableV2>
      Returns:
      a newly built instance of TableV2.