Class TablePropsV2.Builder
java.lang.Object
software.amazon.awscdk.services.dynamodb.TablePropsV2.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<TablePropsV2>
- Enclosing interface:
TablePropsV2
@Stability(Stable)
public static final class TablePropsV2.Builder
extends Object
implements software.amazon.jsii.Builder<TablePropsV2>
A builder for
TablePropsV2-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofTablePropsV2.getBilling()build()Builds the configured instance.contributorInsights(Boolean contributorInsights) Deprecated.use `contributorInsightsSpecification` insteadcontributorInsightsSpecification(ContributorInsightsSpecification contributorInsightsSpecification) Sets the value ofTableOptionsV2.getContributorInsightsSpecification()deletionProtection(Boolean deletionProtection) Sets the value ofTableOptionsV2.getDeletionProtection()dynamoStream(StreamViewType dynamoStream) Sets the value ofTablePropsV2.getDynamoStream()encryption(TableEncryptionV2 encryption) Sets the value ofTablePropsV2.getEncryption()globalSecondaryIndexes(List<? extends GlobalSecondaryIndexPropsV2> globalSecondaryIndexes) Sets the value ofTablePropsV2.getGlobalSecondaryIndexes()kinesisStream(IStream kinesisStream) Sets the value ofTableOptionsV2.getKinesisStream()localSecondaryIndexes(List<? extends LocalSecondaryIndexProps> localSecondaryIndexes) Sets the value ofTablePropsV2.getLocalSecondaryIndexes()multiRegionConsistency(MultiRegionConsistency multiRegionConsistency) Sets the value ofTablePropsV2.getMultiRegionConsistency()partitionKey(Attribute partitionKey) Sets the value ofTablePropsV2.getPartitionKey()pointInTimeRecovery(Boolean pointInTimeRecovery) Deprecated.use `pointInTimeRecoverySpecification` insteadpointInTimeRecoverySpecification(PointInTimeRecoverySpecification pointInTimeRecoverySpecification) Sets the value ofTableOptionsV2.getPointInTimeRecoverySpecification()removalPolicy(RemovalPolicy removalPolicy) Sets the value ofTablePropsV2.getRemovalPolicy()replicas(List<? extends ReplicaTableProps> replicas) Sets the value ofTablePropsV2.getReplicas()resourcePolicy(PolicyDocument resourcePolicy) Sets the value ofTableOptionsV2.getResourcePolicy()Sets the value ofTablePropsV2.getSortKey()tableClass(TableClass tableClass) Sets the value ofTableOptionsV2.getTableClass()Sets the value ofTablePropsV2.getTableName()Sets the value ofTableOptionsV2.getTags()timeToLiveAttribute(String timeToLiveAttribute) Sets the value ofTablePropsV2.getTimeToLiveAttribute()warmThroughput(WarmThroughput warmThroughput) Sets the value ofTablePropsV2.getWarmThroughput()witnessRegion(String witnessRegion) Sets the value ofTablePropsV2.getWitnessRegion()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
partitionKey
Sets the value ofTablePropsV2.getPartitionKey()- Parameters:
partitionKey- Partition key attribute definition. This parameter is required.- Returns:
this
-
billing
Sets the value ofTablePropsV2.getBilling()- Parameters:
billing- The billing mode and capacity settings to apply to the table.- Returns:
this
-
dynamoStream
Sets the value ofTablePropsV2.getDynamoStream()- Parameters:
dynamoStream- When an item in the table is modified, StreamViewType determines what information is written to the stream.- Returns:
this
-
encryption
Sets the value ofTablePropsV2.getEncryption()- Parameters:
encryption- The server-side encryption.- Returns:
this
-
globalSecondaryIndexes
@Stability(Stable) public TablePropsV2.Builder globalSecondaryIndexes(List<? extends GlobalSecondaryIndexPropsV2> globalSecondaryIndexes) Sets the value ofTablePropsV2.getGlobalSecondaryIndexes()- Parameters:
globalSecondaryIndexes- Global secondary indexes. Note: You can provide a maximum of 20 global secondary indexes.- Returns:
this
-
localSecondaryIndexes
@Stability(Stable) public TablePropsV2.Builder localSecondaryIndexes(List<? extends LocalSecondaryIndexProps> localSecondaryIndexes) Sets the value ofTablePropsV2.getLocalSecondaryIndexes()- Parameters:
localSecondaryIndexes- Local secondary indexes. Note: You can only provide a maximum of 5 local secondary indexes.- Returns:
this
-
multiRegionConsistency
@Stability(Stable) public TablePropsV2.Builder multiRegionConsistency(MultiRegionConsistency multiRegionConsistency) Sets the value ofTablePropsV2.getMultiRegionConsistency()- Parameters:
multiRegionConsistency- Specifies the consistency mode for a new global table.- Returns:
this
-
removalPolicy
Sets the value ofTablePropsV2.getRemovalPolicy()- Parameters:
removalPolicy- The removal policy applied to the table.- Returns:
this
-
replicas
Sets the value ofTablePropsV2.getReplicas()- Parameters:
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.- Returns:
this
-
sortKey
Sets the value ofTablePropsV2.getSortKey()- Parameters:
sortKey- Sort key attribute definition.- Returns:
this
-
tableName
Sets the value ofTablePropsV2.getTableName()- Parameters:
tableName- The name of the table.- Returns:
this
-
timeToLiveAttribute
Sets the value ofTablePropsV2.getTimeToLiveAttribute()- Parameters:
timeToLiveAttribute- The name of the TTL attribute.- Returns:
this
-
warmThroughput
Sets the value ofTablePropsV2.getWarmThroughput()- Parameters:
warmThroughput- The warm throughput configuration for the table.- Returns:
this
-
witnessRegion
Sets the value ofTablePropsV2.getWitnessRegion()- Parameters:
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.
- Returns:
this
-
contributorInsights
@Stability(Deprecated) @Deprecated public TablePropsV2.Builder contributorInsights(Boolean contributorInsights) Deprecated.use `contributorInsightsSpecification` insteadSets the value ofTableOptionsV2.getContributorInsights()- Parameters:
contributorInsights- Whether CloudWatch contributor insights is enabled.- Returns:
this
-
contributorInsightsSpecification
@Stability(Stable) public TablePropsV2.Builder contributorInsightsSpecification(ContributorInsightsSpecification contributorInsightsSpecification) Sets the value ofTableOptionsV2.getContributorInsightsSpecification()- Parameters:
contributorInsightsSpecification- Whether CloudWatch contributor insights is enabled and what mode is selected.- Returns:
this
-
deletionProtection
Sets the value ofTableOptionsV2.getDeletionProtection()- Parameters:
deletionProtection- Whether deletion protection is enabled.- Returns:
this
-
kinesisStream
Sets the value ofTableOptionsV2.getKinesisStream()- Parameters:
kinesisStream- Kinesis Data Stream to capture item level changes.- Returns:
this
-
pointInTimeRecovery
@Stability(Deprecated) @Deprecated public TablePropsV2.Builder pointInTimeRecovery(Boolean pointInTimeRecovery) Deprecated.use `pointInTimeRecoverySpecification` insteadSets the value ofTableOptionsV2.getPointInTimeRecovery()- Parameters:
pointInTimeRecovery- Whether point-in-time recovery is enabled.- Returns:
this
-
pointInTimeRecoverySpecification
@Stability(Stable) public TablePropsV2.Builder pointInTimeRecoverySpecification(PointInTimeRecoverySpecification pointInTimeRecoverySpecification) Sets the value ofTableOptionsV2.getPointInTimeRecoverySpecification()- Parameters:
pointInTimeRecoverySpecification- Whether point-in-time recovery is enabled and recoveryPeriodInDays is set.- Returns:
this
-
resourcePolicy
Sets the value ofTableOptionsV2.getResourcePolicy()- Parameters:
resourcePolicy- Resource policy to assign to DynamoDB Table.- Returns:
this
-
tableClass
Sets the value ofTableOptionsV2.getTableClass()- Parameters:
tableClass- The table class.- Returns:
this
-
tags
Sets the value ofTableOptionsV2.getTags()- Parameters:
tags- Tags to be applied to the primary table (default replica table).- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<TablePropsV2>- Returns:
- a new instance of
TablePropsV2 - Throws:
NullPointerException- if any required attribute was not provided
-