Interface TableOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
,SchemaOptions
- All Known Subinterfaces:
TableProps
- All Known Implementing Classes:
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.*; import software.amazon.awscdk.services.dynamodb.*; import software.amazon.awscdk.services.iam.*; import software.amazon.awscdk.services.kms.*; import software.amazon.awscdk.services.s3.*; Bucket bucket; InputFormat inputFormat; Key key; PolicyDocument policyDocument; 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) .deletionProtection(false) .encryption(TableEncryption.DEFAULT) .encryptionKey(key) .importSource(ImportSourceSpecification.builder() .bucket(bucket) .inputFormat(inputFormat) // the properties below are optional .bucketOwner("bucketOwner") .compressionType(InputCompressionType.GZIP) .keyPrefix("keyPrefix") .build()) .maxReadRequestUnits(123) .maxWriteRequestUnits(123) .pointInTimeRecovery(false) .pointInTimeRecoverySpecification(PointInTimeRecoverySpecification.builder() .pointInTimeRecoveryEnabled(false) // the properties below are optional .recoveryPeriodInDays(123) .build()) .readCapacity(123) .removalPolicy(RemovalPolicy.DESTROY) .replicationRegions(List.of("replicationRegions")) .replicationTimeout(Duration.minutes(30)) .resourcePolicy(policyDocument) .sortKey(Attribute.builder() .name("name") .type(AttributeType.BINARY) .build()) .stream(StreamViewType.NEW_IMAGE) .tableClass(TableClass.STANDARD) .timeToLiveAttribute("timeToLiveAttribute") .waitForReplicationToFinish(false) .warmThroughput(WarmThroughput.builder() .readUnitsPerSecond(123) .writeUnitsPerSecond(123) .build()) .writeCapacity(123) .build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
A builder forTableOptions
static final class
An implementation forTableOptions
-
Method Summary
Modifier and TypeMethodDescriptionstatic TableOptions.Builder
builder()
default BillingMode
Specify how you are charged for read and write throughput and how you manage capacity.default Boolean
Whether CloudWatch contributor insights is enabled.default Boolean
Enables deletion protection for the table.default TableEncryption
Whether server-side encryption with an AWS managed customer master key is enabled.default IKey
External KMS key to use for table encryption.default ImportSourceSpecification
The properties of data being imported from the S3 bucket source to the table.default Number
The maximum read request units for the table.default Number
The write request units for the table.default Boolean
Deprecated.default PointInTimeRecoverySpecification
Whether point-in-time recovery is enabled and recoveryPeriodInDays is set.default Number
The read capacity for the table.default RemovalPolicy
The removal policy to apply to the DynamoDB Table.Regions where replica tables will be created.default Duration
The timeout for a table replication operation in a single region.default PolicyDocument
Resource policy to assign to table.default StreamViewType
When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.default TableClass
Specify the table class.default String
The name of TTL attribute.default Boolean
[WARNING: Use this flag with caution, misusing this flag may cause deleting existing replicas, refer to the detailed documentation for more information] Indicates whether CloudFormation stack waits for replication to finish.default WarmThroughput
Specify values to pre-warm you DynamoDB Table Warm Throughput feature is not available for Global Table replicas using theTable
construct.default Number
The write capacity for the table.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
Methods 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
-
getDeletionProtection
Enables deletion protection for the table.Default: false
-
getEncryption
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.
-
getEncryptionKey
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.
-
getImportSource
The properties of data being imported from the S3 bucket source to the table.Default: - no data import from the S3 bucket
-
getMaxReadRequestUnits
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
-
getMaxWriteRequestUnits
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
-
getPointInTimeRecovery
Deprecated.usepointInTimeRecoverySpecification
instead(deprecated) Whether point-in-time recovery is enabled.Default: false - point in time recovery is not enabled.
-
getPointInTimeRecoverySpecification
@Stability(Stable) @Nullable default PointInTimeRecoverySpecification getPointInTimeRecoverySpecification()Whether point-in-time recovery is enabled and recoveryPeriodInDays is set.Default: - point in time recovery is not enabled.
-
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)
-
getResourcePolicy
Resource policy to assign to table.Default: - No resource policy statement
- See Also:
-
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
[WARNING: Use this flag with caution, misusing this flag may cause deleting existing replicas, refer to the detailed documentation for more information] 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
- See Also:
-
getWarmThroughput
Specify values to pre-warm you DynamoDB Table Warm Throughput feature is not available for Global Table replicas using theTable
construct.To enable Warm Throughput, use the
TableV2
construct instead.Default: - warm throughput is not configured
- See Also:
-
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.Builder
ofTableOptions
-
pointInTimeRecoverySpecification
instead