Class TableProps.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • kinesisStream

      @Stability(Stable) public TableProps.Builder kinesisStream(IStream kinesisStream)
      Parameters:
      kinesisStream - Kinesis Data Stream to capture item-level changes for the table.
      Returns:
      this
    • tableName

      @Stability(Stable) public TableProps.Builder tableName(String tableName)
      Sets the value of TableProps.getTableName()
      Parameters:
      tableName - Enforces a particular physical table name.
      Returns:
      this
    • billingMode

      @Stability(Stable) public TableProps.Builder billingMode(BillingMode billingMode)
      Parameters:
      billingMode - Specify how you are charged for read and write throughput and how you manage capacity.
      Returns:
      this
    • contributorInsightsEnabled

      @Stability(Stable) public TableProps.Builder contributorInsightsEnabled(Boolean contributorInsightsEnabled)
      Parameters:
      contributorInsightsEnabled - Whether CloudWatch contributor insights is enabled.
      Returns:
      this
    • encryption

      @Stability(Stable) public TableProps.Builder encryption(TableEncryption encryption)
      Parameters:
      encryption - Whether server-side encryption with an AWS managed customer master key is enabled. This property cannot be set if serverSideEncryption is set.

      NOTE: if you set this to CUSTOMER_MANAGED and encryptionKey is not specified, the key that the Tablet generates for you will be created with default permissions. If you are using CDKv2, these permissions will be sufficient to enable the key for use with DynamoDB tables. If you are using CDKv1, make sure the feature flag @aws-cdk/aws-kms:defaultKeyPolicies is set to true in your cdk.json.

      Returns:
      this
    • encryptionKey

      @Stability(Stable) public TableProps.Builder encryptionKey(IKey encryptionKey)
      Parameters:
      encryptionKey - External KMS key to use for table encryption. This property can only be set if encryption is set to TableEncryption.CUSTOMER_MANAGED.
      Returns:
      this
    • pointInTimeRecovery

      @Stability(Stable) public TableProps.Builder pointInTimeRecovery(Boolean pointInTimeRecovery)
      Parameters:
      pointInTimeRecovery - Whether point-in-time recovery is enabled.
      Returns:
      this
    • readCapacity

      @Stability(Stable) public TableProps.Builder readCapacity(Number readCapacity)
      Parameters:
      readCapacity - The read capacity for the table. Careful if you add Global Secondary Indexes, as those will share the table's provisioned throughput.

      Can only be provided if billingMode is Provisioned.

      Returns:
      this
    • removalPolicy

      @Stability(Stable) public TableProps.Builder removalPolicy(RemovalPolicy removalPolicy)
      Parameters:
      removalPolicy - The removal policy to apply to the DynamoDB Table.
      Returns:
      this
    • replicationRegions

      @Stability(Stable) public TableProps.Builder replicationRegions(List<String> replicationRegions)
      Parameters:
      replicationRegions - Regions where replica tables will be created.
      Returns:
      this
    • replicationTimeout

      @Stability(Stable) public TableProps.Builder replicationTimeout(Duration replicationTimeout)
      Parameters:
      replicationTimeout - The timeout for a table replication operation in a single region.
      Returns:
      this
    • serverSideEncryption

      @Stability(Deprecated) @Deprecated public TableProps.Builder serverSideEncryption(Boolean serverSideEncryption)
      Deprecated.
      This property is deprecated. In order to obtain the same behavior as enabling this, set the `encryption` property to `TableEncryption.AWS_MANAGED` instead.
      Parameters:
      serverSideEncryption - Whether server-side encryption with an AWS managed customer master key is enabled. This property cannot be set if encryption and/or encryptionKey is set.
      Returns:
      this
    • stream

      @Stability(Stable) public TableProps.Builder stream(StreamViewType stream)
      Sets the value of TableOptions.getStream()
      Parameters:
      stream - When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.
      Returns:
      this
    • tableClass

      @Stability(Stable) public TableProps.Builder tableClass(TableClass tableClass)
      Parameters:
      tableClass - Specify the table class.
      Returns:
      this
    • timeToLiveAttribute

      @Stability(Stable) public TableProps.Builder timeToLiveAttribute(String timeToLiveAttribute)
      Parameters:
      timeToLiveAttribute - The name of TTL attribute.
      Returns:
      this
    • waitForReplicationToFinish

      @Stability(Stable) public TableProps.Builder waitForReplicationToFinish(Boolean waitForReplicationToFinish)
      Parameters:
      waitForReplicationToFinish - Indicates whether CloudFormation stack waits for replication to finish. If set to false, the CloudFormation resource will mark the resource as created and replication will be completed asynchronously. This property is ignored if replicationRegions property is not set.

      DO NOT UNSET this property if adding/removing multiple replicationRegions in one deployment, as CloudFormation only supports one region replication at a time. CDK overcomes this limitation by waiting for replication to finish before starting new replicationRegion.

      Returns:
      this
    • writeCapacity

      @Stability(Stable) public TableProps.Builder writeCapacity(Number writeCapacity)
      Parameters:
      writeCapacity - The write capacity for the table. Careful if you add Global Secondary Indexes, as those will share the table's provisioned throughput.

      Can only be provided if billingMode is Provisioned.

      Returns:
      this
    • partitionKey

      @Stability(Stable) public TableProps.Builder partitionKey(Attribute partitionKey)
      Parameters:
      partitionKey - Partition key attribute definition. This parameter is required.
      Returns:
      this
    • sortKey

      @Stability(Stable) public TableProps.Builder sortKey(Attribute sortKey)
      Sets the value of SchemaOptions.getSortKey()
      Parameters:
      sortKey - Sort key attribute definition.
      Returns:
      this
    • build

      @Stability(Stable) public TableProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<TableProps>
      Returns:
      a new instance of TableProps
      Throws:
      NullPointerException - if any required attribute was not provided