@Stability(value=Experimental)
See: Description
| Interface | Description |
|---|---|
| Attribute |
EXPERIMENTAL
|
| CfnTable.AttributeDefinitionProperty |
EXPERIMENTAL
|
| CfnTable.GlobalSecondaryIndexProperty |
EXPERIMENTAL
|
| CfnTable.KeySchemaProperty |
EXPERIMENTAL
|
| CfnTable.LocalSecondaryIndexProperty |
EXPERIMENTAL
|
| CfnTable.PointInTimeRecoverySpecificationProperty |
EXPERIMENTAL
|
| CfnTable.ProjectionProperty |
EXPERIMENTAL
|
| CfnTable.ProvisionedThroughputProperty |
EXPERIMENTAL
|
| CfnTable.SSESpecificationProperty |
EXPERIMENTAL
|
| CfnTable.StreamSpecificationProperty |
EXPERIMENTAL
|
| CfnTable.TimeToLiveSpecificationProperty |
EXPERIMENTAL
|
| CfnTableProps |
Properties for defining a `AWS::DynamoDB::Table`.
|
| EnableScalingProps |
Properties for enabling DynamoDB capacity scaling.
|
| GlobalSecondaryIndexProps |
EXPERIMENTAL
|
| IScalableTableAttribute |
Interface for scalable attributes.
|
| LocalSecondaryIndexProps |
EXPERIMENTAL
|
| SecondaryIndexProps |
EXPERIMENTAL
|
| TableOptions |
EXPERIMENTAL
|
| TableProps |
EXPERIMENTAL
|
| UtilizationScalingProps |
Properties for enabling DynamoDB utilization tracking.
|
| Class | Description |
|---|---|
| Attribute.Builder |
A builder for
Attribute |
| Attribute.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnTable |
A CloudFormation `AWS::DynamoDB::Table`.
|
| CfnTable.AttributeDefinitionProperty.Builder |
A builder for
CfnTable.AttributeDefinitionProperty |
| CfnTable.AttributeDefinitionProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnTable.GlobalSecondaryIndexProperty.Builder |
A builder for
CfnTable.GlobalSecondaryIndexProperty |
| CfnTable.GlobalSecondaryIndexProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnTable.KeySchemaProperty.Builder |
A builder for
CfnTable.KeySchemaProperty |
| CfnTable.KeySchemaProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnTable.LocalSecondaryIndexProperty.Builder |
A builder for
CfnTable.LocalSecondaryIndexProperty |
| CfnTable.LocalSecondaryIndexProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnTable.PointInTimeRecoverySpecificationProperty.Builder |
A builder for
CfnTable.PointInTimeRecoverySpecificationProperty |
| CfnTable.PointInTimeRecoverySpecificationProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnTable.ProjectionProperty.Builder |
A builder for
CfnTable.ProjectionProperty |
| CfnTable.ProjectionProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnTable.ProvisionedThroughputProperty.Builder |
A builder for
CfnTable.ProvisionedThroughputProperty |
| CfnTable.ProvisionedThroughputProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnTable.SSESpecificationProperty.Builder |
A builder for
CfnTable.SSESpecificationProperty |
| CfnTable.SSESpecificationProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnTable.StreamSpecificationProperty.Builder |
A builder for
CfnTable.StreamSpecificationProperty |
| CfnTable.StreamSpecificationProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnTable.TimeToLiveSpecificationProperty.Builder |
A builder for
CfnTable.TimeToLiveSpecificationProperty |
| CfnTable.TimeToLiveSpecificationProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnTableProps.Builder |
A builder for
CfnTableProps |
| CfnTableProps.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| EnableScalingProps.Builder |
A builder for
EnableScalingProps |
| EnableScalingProps.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| GlobalSecondaryIndexProps.Builder |
A builder for
GlobalSecondaryIndexProps |
| GlobalSecondaryIndexProps.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| IScalableTableAttribute.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| LocalSecondaryIndexProps.Builder |
A builder for
LocalSecondaryIndexProps |
| LocalSecondaryIndexProps.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| SecondaryIndexProps.Builder |
A builder for
SecondaryIndexProps |
| SecondaryIndexProps.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| Table |
Provides a DynamoDB table.
|
| TableOptions.Builder |
A builder for
TableOptions |
| TableOptions.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| TableProps.Builder |
A builder for
TableProps |
| TableProps.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| UtilizationScalingProps.Builder |
A builder for
UtilizationScalingProps |
| UtilizationScalingProps.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| Enum | Description |
|---|---|
| AttributeType |
EXPERIMENTAL
|
| BillingMode |
DyanmoDB's Read/Write capacity modes.
|
| ProjectionType |
EXPERIMENTAL
|
| StreamViewType |
When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.
|
This is a developer preview (public beta) module. Releases might lack important features and might have future breaking changes.
This API is still under active development and subject to non-backward compatible changes or removal in any future version. Use of the API is not recommended in production environments. Experimental APIs are not subject to the Semantic Versioning model.
Here is a minimal deployable DynamoDB table definition:
import dynamodb = require('@aws-cdk/aws-dynamodb');
const table = new dynamodb.Table(this, 'Table', {
partitionKey: { name: 'id', type: dynamodb.AttributeType.String }
});
When a table is defined, you must define it's schema using the partitionKey
(required) and sortKey (optional) properties.
DynamoDB supports two billing modes:
import dynamodb = require('@aws-cdk/aws-dynamodb');
const table = new dynamodb.Table(this, 'Table', {
partitionKey: { name: 'id', type: dynamodb.AttributeType.String },
billingMode: dynamodb.BillingMode.PayPerRequest
});
Further reading: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.
You can have DynamoDB automatically raise and lower the read and write capacities of your table by setting up autoscaling. You can use this to either keep your tables at a desired utilization level, or by scaling up and down at preconfigured times of the day:
Auto-scaling is only relevant for tables with the billing mode, PROVISIONED.
const readScaling = table.autoScaleReadCapacity({ minCapacity: 1, maxCapacity: 50 });
readScaling.scaleOnUtilization({
targetUtilizationPercent: 50
});
readScaling.scaleOnSchedule('ScaleUpInTheMorning', {
schedule: appscaling.Schedule.cron({ hour: '8', minute: '0' }),
minCapacity: 20,
});
readScaling.scaleOnSchedule('ScaleDownAtNight', {
schedule: appscaling.Schedule.cron({ hour: '20', minute: '0' }),
maxCapacity: 20
});
Further reading: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/AutoScaling.html https://aws.amazon.com/blogs/database/how-to-use-aws-cloudformation-to-configure-auto-scaling-for-amazon-dynamodb-tables-and-indexes/
Please see the @aws-cdk/aws-dynamodb-global package here.
Copyright © 2019. All rights reserved.