Class TableProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<TableProps>
- Enclosing interface:
TableProps
TableProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbillingMode
(BillingMode billingMode) Sets the value ofTableOptions.getBillingMode()
build()
Builds the configured instance.contributorInsightsEnabled
(Boolean contributorInsightsEnabled) Sets the value ofTableOptions.getContributorInsightsEnabled()
encryption
(TableEncryption encryption) Sets the value ofTableOptions.getEncryption()
encryptionKey
(IKey encryptionKey) Sets the value ofTableOptions.getEncryptionKey()
kinesisStream
(IStream kinesisStream) Sets the value ofTableProps.getKinesisStream()
partitionKey
(Attribute partitionKey) Sets the value ofSchemaOptions.getPartitionKey()
pointInTimeRecovery
(Boolean pointInTimeRecovery) Sets the value ofTableOptions.getPointInTimeRecovery()
readCapacity
(Number readCapacity) Sets the value ofTableOptions.getReadCapacity()
removalPolicy
(RemovalPolicy removalPolicy) Sets the value ofTableOptions.getRemovalPolicy()
replicationRegions
(List<String> replicationRegions) Sets the value ofTableOptions.getReplicationRegions()
replicationTimeout
(Duration replicationTimeout) Sets the value ofTableOptions.getReplicationTimeout()
serverSideEncryption
(Boolean serverSideEncryption) Deprecated.This property is deprecated.Sets the value ofSchemaOptions.getSortKey()
stream
(StreamViewType stream) Sets the value ofTableOptions.getStream()
tableClass
(TableClass tableClass) Sets the value ofTableOptions.getTableClass()
Sets the value ofTableProps.getTableName()
timeToLiveAttribute
(String timeToLiveAttribute) Sets the value ofTableOptions.getTimeToLiveAttribute()
waitForReplicationToFinish
(Boolean waitForReplicationToFinish) Sets the value ofTableOptions.getWaitForReplicationToFinish()
writeCapacity
(Number writeCapacity) Sets the value ofTableOptions.getWriteCapacity()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
kinesisStream
Sets the value ofTableProps.getKinesisStream()
- Parameters:
kinesisStream
- Kinesis Data Stream to capture item-level changes for the table.- Returns:
this
-
tableName
Sets the value ofTableProps.getTableName()
- Parameters:
tableName
- Enforces a particular physical table name.- Returns:
this
-
billingMode
Sets the value ofTableOptions.getBillingMode()
- 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) Sets the value ofTableOptions.getContributorInsightsEnabled()
- Parameters:
contributorInsightsEnabled
- Whether CloudWatch contributor insights is enabled.- Returns:
this
-
encryption
Sets the value ofTableOptions.getEncryption()
- Parameters:
encryption
- Whether server-side encryption with an AWS managed customer master key is enabled. This property cannot be set ifserverSideEncryption
is set.NOTE: if you set this to
CUSTOMER_MANAGED
andencryptionKey
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 totrue
in yourcdk.json
.- Returns:
this
-
encryptionKey
Sets the value ofTableOptions.getEncryptionKey()
- Parameters:
encryptionKey
- External KMS key to use for table encryption. This property can only be set ifencryption
is set toTableEncryption.CUSTOMER_MANAGED
.- Returns:
this
-
pointInTimeRecovery
Sets the value ofTableOptions.getPointInTimeRecovery()
- Parameters:
pointInTimeRecovery
- Whether point-in-time recovery is enabled.- Returns:
this
-
readCapacity
Sets the value ofTableOptions.getReadCapacity()
- 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
Sets the value ofTableOptions.getRemovalPolicy()
- Parameters:
removalPolicy
- The removal policy to apply to the DynamoDB Table.- Returns:
this
-
replicationRegions
Sets the value ofTableOptions.getReplicationRegions()
- Parameters:
replicationRegions
- Regions where replica tables will be created.- Returns:
this
-
replicationTimeout
Sets the value ofTableOptions.getReplicationTimeout()
- 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.Sets the value ofTableOptions.getServerSideEncryption()
- Parameters:
serverSideEncryption
- Whether server-side encryption with an AWS managed customer master key is enabled. This property cannot be set ifencryption
and/orencryptionKey
is set.- Returns:
this
-
stream
Sets the value ofTableOptions.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
Sets the value ofTableOptions.getTableClass()
- Parameters:
tableClass
- Specify the table class.- Returns:
this
-
timeToLiveAttribute
Sets the value ofTableOptions.getTimeToLiveAttribute()
- Parameters:
timeToLiveAttribute
- The name of TTL attribute.- Returns:
this
-
waitForReplicationToFinish
@Stability(Stable) public TableProps.Builder waitForReplicationToFinish(Boolean waitForReplicationToFinish) Sets the value ofTableOptions.getWaitForReplicationToFinish()
- 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
Sets the value ofTableOptions.getWriteCapacity()
- 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
Sets the value ofSchemaOptions.getPartitionKey()
- Parameters:
partitionKey
- Partition key attribute definition. This parameter is required.- Returns:
this
-
sortKey
Sets the value ofSchemaOptions.getSortKey()
- Parameters:
sortKey
- Sort key attribute definition.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<TableProps>
- Returns:
- a new instance of
TableProps
- Throws:
NullPointerException
- if any required attribute was not provided
-