Class TableOptions.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • billingMode

      @Stability(Stable) public TableOptions.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 TableOptions.Builder contributorInsightsEnabled(Boolean contributorInsightsEnabled)
      Parameters:
      contributorInsightsEnabled - Whether CloudWatch contributor insights is enabled.
      Returns:
      this
    • deletionProtection

      @Stability(Stable) public TableOptions.Builder deletionProtection(Boolean deletionProtection)
      Parameters:
      deletionProtection - Enables deletion protection for the table.
      Returns:
      this
    • encryption

      @Stability(Stable) public TableOptions.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 TableOptions.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
    • importSource

      @Stability(Stable) public TableOptions.Builder importSource(ImportSourceSpecification importSource)
      Parameters:
      importSource - The properties of data being imported from the S3 bucket source to the table.
      Returns:
      this
    • maxReadRequestUnits

      @Stability(Stable) public TableOptions.Builder maxReadRequestUnits(Number maxReadRequestUnits)
      Parameters:
      maxReadRequestUnits - The maximum read request units for the table. Careful if you add Global Secondary Indexes, as those will share the table's maximum on-demand throughput.

      Can only be provided if billingMode is PAY_PER_REQUEST.

      Returns:
      this
    • maxWriteRequestUnits

      @Stability(Stable) public TableOptions.Builder maxWriteRequestUnits(Number maxWriteRequestUnits)
      Parameters:
      maxWriteRequestUnits - The write request units for the table. Careful if you add Global Secondary Indexes, as those will share the table's maximum on-demand throughput.

      Can only be provided if billingMode is PAY_PER_REQUEST.

      Returns:
      this
    • pointInTimeRecovery

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

      @Stability(Stable) public TableOptions.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 TableOptions.Builder removalPolicy(RemovalPolicy removalPolicy)
      Parameters:
      removalPolicy - The removal policy to apply to the DynamoDB Table.
      Returns:
      this
    • replicationRegions

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

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

      @Stability(Stable) public TableOptions.Builder resourcePolicy(PolicyDocument resourcePolicy)
      Parameters:
      resourcePolicy - Resource policy to assign to table.
      Returns:
      this
    • stream

      @Stability(Stable) public TableOptions.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 TableOptions.Builder tableClass(TableClass tableClass)
      Parameters:
      tableClass - Specify the table class.
      Returns:
      this
    • timeToLiveAttribute

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

      @Stability(Stable) public TableOptions.Builder waitForReplicationToFinish(Boolean waitForReplicationToFinish)
      Parameters:
      waitForReplicationToFinish - [WARNING: Use this flag with caution, misusing this flag may cause deleting existing replicas, refer to the detailed documentation for more information] 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.

      WARNING: 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.

      If the custom resource which handles replication has a physical resource ID with the format region instead of tablename-region (this would happen if the custom resource hasn't received an event since v1.91.0), DO NOT SET this property to false without making a change to the table name. This will cause the existing replicas to be deleted.

      Returns:
      this
    • writeCapacity

      @Stability(Stable) public TableOptions.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 TableOptions.Builder partitionKey(Attribute partitionKey)
      Parameters:
      partitionKey - Partition key attribute definition. This parameter is required.
      Returns:
      this
    • sortKey

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

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