Interface TableOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable,SchemaOptions
- All Known Subinterfaces:
GlobalTableProps,TableProps
- All Known Implementing Classes:
GlobalTableProps.Jsii$Proxy,TableOptions.Jsii$Proxy,TableProps.Jsii$Proxy
Use 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.services.dynamodb.*;
import software.amazon.awscdk.services.kms.*;
import software.amazon.awscdk.core.*;
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))
.serverSideEncryption(false)
.sortKey(Attribute.builder()
.name("name")
.type(AttributeType.BINARY)
.build())
.stream(StreamViewType.NEW_IMAGE)
.tableClass(TableClass.STANDARD)
.timeToLiveAttribute("timeToLiveAttribute")
.waitForReplicationToFinish(false)
.writeCapacity(123)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forTableOptionsstatic final classAn implementation forTableOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic TableOptions.Builderbuilder()default BillingModeSpecify how you are charged for read and write throughput and how you manage capacity.default BooleanWhether CloudWatch contributor insights is enabled.default TableEncryptionWhether server-side encryption with an AWS managed customer master key is enabled.default IKeyExternal KMS key to use for table encryption.default BooleanWhether point-in-time recovery is enabled.default NumberThe read capacity for the table.default RemovalPolicyThe removal policy to apply to the DynamoDB Table.Regions where replica tables will be created.default DurationThe timeout for a table replication operation in a single region.default BooleanDeprecated.This property is deprecated.default StreamViewTypeWhen an item in the table is modified, StreamViewType determines what information is written to the stream for this table.default TableClassSpecify the table class.default StringThe name of TTL attribute.default BooleanIndicates whether CloudFormation stack waits for replication to finish.default NumberThe write capacity for the table.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJsonMethods inherited from interface software.amazon.awscdk.services.dynamodb.SchemaOptions
getPartitionKey, getSortKey
-
Method Details
-
getBillingMode
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
-
getContributorInsightsEnabled
Whether CloudWatch contributor insights is enabled.Default: false
-
getEncryption
Whether server-side encryption with an AWS managed customer master key is enabled.This property cannot be set if
serverSideEncryptionis 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: - server-side encryption is enabled with an AWS owned customer master key
-
getEncryptionKey
External KMS key to use for table encryption.This property can only be set if
encryptionis 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.
-
getPointInTimeRecovery
Whether point-in-time recovery is enabled.Default: - point-in-time recovery is disabled
-
getReadCapacity
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
-
getRemovalPolicy
The removal policy to apply to the DynamoDB Table.Default: RemovalPolicy.RETAIN
-
getReplicationRegions
Regions where replica tables will be created.Default: - no replica tables are created
-
getReplicationTimeout
The timeout for a table replication operation in a single region.Default: Duration.minutes(30)
-
getServerSideEncryption
Deprecated.This property is deprecated. In order to obtain the same behavior as enabling this, set theencryptionproperty toTableEncryption.AWS_MANAGEDinstead.(deprecated) Whether server-side encryption with an AWS managed customer master key is enabled.This property cannot be set if
encryptionand/orencryptionKeyis set.Default: - server-side encryption is enabled with an AWS owned customer master key
-
getStream
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
-
getTableClass
Specify the table class.Default: STANDARD
-
getTimeToLiveAttribute
The name of TTL attribute.Default: - TTL is disabled
-
getWaitForReplicationToFinish
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
-
getWriteCapacity
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
-
builder
- Returns:
- a
TableOptions.BuilderofTableOptions
-