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(Deprecated) @Deprecated public TableV2.Builder contributorInsights(Boolean contributorInsights)
      Deprecated.
      use contributorInsightsSpecification instead
      (deprecated) Whether CloudWatch contributor insights is enabled.

      Default: false

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

      @Stability(Stable) public TableV2.Builder contributorInsightsSpecification(ContributorInsightsSpecification contributorInsightsSpecification)
      Whether CloudWatch contributor insights is enabled and what mode is selected.

      Default: - contributor insights is not enabled

      Parameters:
      contributorInsightsSpecification - Whether CloudWatch contributor insights is enabled and what mode is selected. 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(Deprecated) @Deprecated public TableV2.Builder pointInTimeRecovery(Boolean pointInTimeRecovery)
      Deprecated.
      use pointInTimeRecoverySpecification instead
      (deprecated) Whether point-in-time recovery is enabled.

      Default: false - point in time recovery is not enabled.

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

      @Stability(Stable) public TableV2.Builder pointInTimeRecoverySpecification(PointInTimeRecoverySpecification pointInTimeRecoverySpecification)
      Whether point-in-time recovery is enabled and recoveryPeriodInDays is set.

      Default: - point in time recovery is not enabled.

      Parameters:
      pointInTimeRecoverySpecification - Whether point-in-time recovery is enabled and recoveryPeriodInDays is set. 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 primary table (default replica table).

      Default: - no tags

      Parameters:
      tags - Tags to be applied to the primary table (default 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
    • globalTableSettingsReplicationMode

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

      Parameters:
      globalTableSettingsReplicationMode - Controls whether table settings are synchronized across replicas. 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
    • multiRegionConsistency

      @Stability(Stable) public TableV2.Builder multiRegionConsistency(MultiRegionConsistency multiRegionConsistency)
      Specifies the consistency mode for a new global table.

      Default: MultiRegionConsistency.EVENTUAL

      Parameters:
      multiRegionConsistency - Specifies the consistency mode for a new global table. 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
    • warmThroughput

      @Stability(Stable) public TableV2.Builder warmThroughput(WarmThroughput warmThroughput)
      The warm throughput configuration for the table.

      Default: - no warm throughput is configured

      Parameters:
      warmThroughput - The warm throughput configuration for the table. This parameter is required.
      Returns:
      this
    • witnessRegion

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

      Parameters:
      witnessRegion - The witness Region for the MRSC global table. 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.