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
deletionProtection
(Boolean deletionProtection) Enables deletion protection for the table.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.importSource
(ImportSourceSpecification importSource) The properties of data being imported from the S3 bucket source to the table.kinesisStream
(IStream kinesisStream) Kinesis Data Stream to capture item-level changes for the table.maxReadRequestUnits
(Number maxReadRequestUnits) The maximum read request units for the table.maxWriteRequestUnits
(Number maxWriteRequestUnits) The write request units 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.resourcePolicy
(PolicyDocument resourcePolicy) Resource policy to assign to table.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
-
deletionProtection
Enables deletion protection for the table.Default: false
- Parameters:
deletionProtection
- Enables deletion protection for the table. 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: - The table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
- 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. If `encryption` and this property are both undefined, then the table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
- Parameters:
encryptionKey
- External KMS key to use for table encryption. This parameter is required.- Returns:
this
-
importSource
The properties of data being imported from the S3 bucket source to the table.Default: - no data import from the S3 bucket
- Parameters:
importSource
- The properties of data being imported from the S3 bucket source to the table. This parameter is required.- Returns:
this
-
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.
Default: - on-demand throughput is disabled
- Parameters:
maxReadRequestUnits
- The maximum read request units for the table. This parameter is required.- Returns:
this
-
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.
Default: - on-demand throughput is disabled
- Parameters:
maxWriteRequestUnits
- The write request units for the table. 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
-
resourcePolicy
Resource policy to assign to table.Default: - No resource policy statement
- Parameters:
resourcePolicy
- Resource policy to assign to table. This parameter is required.- Returns:
this
- See Also:
-
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.
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.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
-