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()
deletionProtection
(Boolean deletionProtection) Sets the value ofTableOptions.getDeletionProtection()
encryption
(TableEncryption encryption) Sets the value ofTableOptions.getEncryption()
encryptionKey
(IKey encryptionKey) Sets the value ofTableOptions.getEncryptionKey()
importSource
(ImportSourceSpecification importSource) Sets the value ofTableOptions.getImportSource()
kinesisStream
(IStream kinesisStream) Sets the value ofTableProps.getKinesisStream()
maxReadRequestUnits
(Number maxReadRequestUnits) Sets the value ofTableOptions.getMaxReadRequestUnits()
maxWriteRequestUnits
(Number maxWriteRequestUnits) Sets the value ofTableOptions.getMaxWriteRequestUnits()
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()
resourcePolicy
(PolicyDocument resourcePolicy) Sets the value ofTableOptions.getResourcePolicy()
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
-
deletionProtection
Sets the value ofTableOptions.getDeletionProtection()
- Parameters:
deletionProtection
- Enables deletion protection for the table.- 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
-
importSource
Sets the value ofTableOptions.getImportSource()
- Parameters:
importSource
- The properties of data being imported from the S3 bucket source to the table.- Returns:
this
-
maxReadRequestUnits
Sets the value ofTableOptions.getMaxReadRequestUnits()
- 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
Sets the value ofTableOptions.getMaxWriteRequestUnits()
- 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
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
-
resourcePolicy
Sets the value ofTableOptions.getResourcePolicy()
- Parameters:
resourcePolicy
- Resource policy to assign to table.- 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
- [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 oftablename-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
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
-