@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.083Z") @Stability(value=Stable) public interface TableOptions extends software.amazon.jsii.JsiiSerializable, SchemaOptions
Use {@link TableProps} for all table properties
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.dynamodb.*;
import software.amazon.awscdk.services.kms.*;
Key key;
TableOptions tableOptions = TableOptions.builder()
.partitionKey(Attribute.builder()
.name("name")
.type(AttributeType.BINARY)
.build())
// the properties below are optional
.billingMode(BillingMode.PAY_PER_REQUEST)
.contributorInsightsEnabled(false)
.encryption(TableEncryption.DEFAULT)
.encryptionKey(key)
.pointInTimeRecovery(false)
.readCapacity(123)
.removalPolicy(RemovalPolicy.DESTROY)
.replicationRegions(List.of("replicationRegions"))
.replicationTimeout(Duration.minutes(30))
.sortKey(Attribute.builder()
.name("name")
.type(AttributeType.BINARY)
.build())
.stream(StreamViewType.NEW_IMAGE)
.tableClass(TableClass.STANDARD)
.timeToLiveAttribute("timeToLiveAttribute")
.waitForReplicationToFinish(false)
.writeCapacity(123)
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
TableOptions.Builder
A builder for
TableOptions |
static class |
TableOptions.Jsii$Proxy
An implementation for
TableOptions |
| Modifier and Type | Method and Description |
|---|---|
static TableOptions.Builder |
builder() |
default BillingMode |
getBillingMode()
Specify how you are charged for read and write throughput and how you manage capacity.
|
default Boolean |
getContributorInsightsEnabled()
Whether CloudWatch contributor insights is enabled.
|
default TableEncryption |
getEncryption()
Whether server-side encryption with an AWS managed customer master key is enabled.
|
default IKey |
getEncryptionKey()
External KMS key to use for table encryption.
|
default Boolean |
getPointInTimeRecovery()
Whether point-in-time recovery is enabled.
|
default Number |
getReadCapacity()
The read capacity for the table.
|
default RemovalPolicy |
getRemovalPolicy()
The removal policy to apply to the DynamoDB Table.
|
default List<String> |
getReplicationRegions()
Regions where replica tables will be created.
|
default Duration |
getReplicationTimeout()
The timeout for a table replication operation in a single region.
|
default StreamViewType |
getStream()
When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.
|
default TableClass |
getTableClass()
Specify the table class.
|
default String |
getTimeToLiveAttribute()
The name of TTL attribute.
|
default Boolean |
getWaitForReplicationToFinish()
Indicates whether CloudFormation stack waits for replication to finish.
|
default Number |
getWriteCapacity()
The write capacity for the table.
|
getPartitionKey, getSortKey@Stability(value=Stable) @Nullable default BillingMode getBillingMode()
Default: PROVISIONED if `replicationRegions` is not specified, PAY_PER_REQUEST otherwise
@Stability(value=Stable) @Nullable default Boolean getContributorInsightsEnabled()
Default: false
@Stability(value=Stable) @Nullable default TableEncryption getEncryption()
This property cannot be set if serverSideEncryption is set.
NOTE: if you set this to
CUSTOMER_MANAGEDandencryptionKeyis 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:defaultKeyPoliciesis set totruein yourcdk.json.
Default: - The table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
@Stability(value=Stable) @Nullable default IKey getEncryptionKey()
This property can only be set if encryption is set to TableEncryption.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.
@Stability(value=Stable) @Nullable default Boolean getPointInTimeRecovery()
Default: - point-in-time recovery is disabled
@Stability(value=Stable) @Nullable default Number getReadCapacity()
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
@Stability(value=Stable) @Nullable default RemovalPolicy getRemovalPolicy()
Default: RemovalPolicy.RETAIN
@Stability(value=Stable) @Nullable default List<String> getReplicationRegions()
Default: - no replica tables are created
@Stability(value=Stable) @Nullable default Duration getReplicationTimeout()
Default: Duration.minutes(30)
@Stability(value=Stable) @Nullable default StreamViewType getStream()
Default: - streams are disabled unless `replicationRegions` is specified
@Stability(value=Stable) @Nullable default TableClass getTableClass()
Default: STANDARD
@Stability(value=Stable) @Nullable default String getTimeToLiveAttribute()
Default: - TTL is disabled
@Stability(value=Stable) @Nullable default Boolean getWaitForReplicationToFinish()
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
@Stability(value=Stable) @Nullable default Number getWriteCapacity()
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
@Stability(value=Stable) static TableOptions.Builder builder()
builder in interface SchemaOptionsTableOptions.Builder of TableOptionsCopyright © 2022. All rights reserved.