Class Table.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<Table>
- Enclosing class:
- Table
Table
.-
Method Summary
Modifier and TypeMethodDescriptionbillingMode
(BillingMode billingMode) Specify how you are charged for read and write throughput and how you manage capacity.build()
contributorInsightsEnabled
(Boolean contributorInsightsEnabled) Whether CloudWatch contributor insights is enabled.static Table.Builder
encryption
(TableEncryption encryption) Whether server-side encryption with an AWS managed customer master key is enabled.encryptionKey
(IKey encryptionKey) External KMS key to use for table encryption.kinesisStream
(IStream kinesisStream) Kinesis Data Stream to capture item-level changes for the table.partitionKey
(Attribute partitionKey) Partition key attribute definition.pointInTimeRecovery
(Boolean pointInTimeRecovery) Whether point-in-time recovery is enabled.readCapacity
(Number readCapacity) The read capacity for the table.removalPolicy
(RemovalPolicy removalPolicy) The removal policy to apply to the DynamoDB Table.replicationRegions
(List<String> replicationRegions) Regions where replica tables will be created.replicationTimeout
(Duration replicationTimeout) The timeout for a table replication operation in a single region.serverSideEncryption
(Boolean serverSideEncryption) Deprecated.This property is deprecated.Sort key attribute definition.stream
(StreamViewType stream) When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.tableClass
(TableClass tableClass) Specify the table class.Enforces a particular physical table name.timeToLiveAttribute
(String timeToLiveAttribute) The name of TTL attribute.waitForReplicationToFinish
(Boolean waitForReplicationToFinish) Indicates whether CloudFormation stack waits for replication to finish.writeCapacity
(Number writeCapacity) The write capacity for the table.
-
Method Details
-
create
@Stability(Stable) public static Table.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
Table.Builder
.
-
partitionKey
Partition key attribute definition.- Parameters:
partitionKey
- Partition key attribute definition. This parameter is required.- Returns:
this
-
sortKey
Sort key attribute definition.Default: no sort key
- Parameters:
sortKey
- Sort key attribute definition. This parameter is required.- Returns:
this
-
billingMode
Specify how you are charged for read and write throughput and how you manage capacity.Default: PROVISIONED if `replicationRegions` is not specified, PAY_PER_REQUEST otherwise
- Parameters:
billingMode
- Specify how you are charged for read and write throughput and how you manage capacity. This parameter is required.- Returns:
this
-
contributorInsightsEnabled
@Stability(Stable) public Table.Builder contributorInsightsEnabled(Boolean contributorInsightsEnabled) Whether CloudWatch contributor insights is enabled.Default: false
- Parameters:
contributorInsightsEnabled
- Whether CloudWatch contributor insights is enabled. This parameter is required.- Returns:
this
-
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
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
.Default: - server-side encryption is enabled with an AWS owned customer master key
- Parameters:
encryption
- Whether server-side encryption with an AWS managed customer master key is enabled. This parameter is required.- Returns:
this
-
encryptionKey
External KMS key to use for table encryption.This property can only be set if
encryption
is set toTableEncryption.CUSTOMER_MANAGED
.Default: - If `encryption` is set to `TableEncryption.CUSTOMER_MANAGED` and this property is undefined, a new KMS key will be created and associated with this table.
- Parameters:
encryptionKey
- External KMS key to use for table encryption. This parameter is required.- Returns:
this
-
pointInTimeRecovery
Whether point-in-time recovery is enabled.Default: - point-in-time recovery is disabled
- Parameters:
pointInTimeRecovery
- Whether point-in-time recovery is enabled. This parameter is required.- Returns:
this
-
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.
Default: 5
- Parameters:
readCapacity
- The read capacity for the table. This parameter is required.- Returns:
this
-
removalPolicy
The removal policy to apply to the DynamoDB Table.Default: RemovalPolicy.RETAIN
- Parameters:
removalPolicy
- The removal policy to apply to the DynamoDB Table. This parameter is required.- Returns:
this
-
replicationRegions
Regions where replica tables will be created.Default: - no replica tables are created
- Parameters:
replicationRegions
- Regions where replica tables will be created. This parameter is required.- Returns:
this
-
replicationTimeout
The timeout for a table replication operation in a single region.Default: Duration.minutes(30)
- Parameters:
replicationTimeout
- The timeout for a table replication operation in a single region. This parameter is required.- Returns:
this
-
serverSideEncryption
@Stability(Deprecated) @Deprecated public Table.Builder serverSideEncryption(Boolean serverSideEncryption) Deprecated.This property is deprecated. In order to obtain the same behavior as enabling this, set theencryption
property toTableEncryption.AWS_MANAGED
instead.(deprecated) Whether server-side encryption with an AWS managed customer master key is enabled.This property cannot be set if
encryption
and/orencryptionKey
is set.Default: - server-side encryption is enabled with an AWS owned customer master key
- Parameters:
serverSideEncryption
- Whether server-side encryption with an AWS managed customer master key is enabled. This parameter is required.- Returns:
this
-
stream
When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.Default: - streams are disabled unless `replicationRegions` is specified
- Parameters:
stream
- When an item in the table is modified, StreamViewType determines what information is written to the stream for this table. This parameter is required.- Returns:
this
-
tableClass
Specify the table class.Default: STANDARD
- Parameters:
tableClass
- Specify the table class. This parameter is required.- Returns:
this
-
timeToLiveAttribute
The name of TTL attribute.Default: - TTL is disabled
- Parameters:
timeToLiveAttribute
- The name of TTL attribute. This parameter is required.- Returns:
this
-
waitForReplicationToFinish
@Stability(Stable) public Table.Builder waitForReplicationToFinish(Boolean 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.
Default: true
- Parameters:
waitForReplicationToFinish
- Indicates whether CloudFormation stack waits for replication to finish. This parameter is required.- Returns:
this
- See Also:
-
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.
Default: 5
- Parameters:
writeCapacity
- The write capacity for the table. This parameter is required.- Returns:
this
-
kinesisStream
Kinesis Data Stream to capture item-level changes for the table.Default: - no Kinesis Data Stream
- Parameters:
kinesisStream
- Kinesis Data Stream to capture item-level changes for the table. This parameter is required.- Returns:
this
-
tableName
Enforces a particular physical table name.Default:
- Parameters:
tableName
- Enforces a particular physical table name. This parameter is required.- Returns:
this
-
build
-