Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@aws-cdk/aws-dynamodb

Package Overview
Dependencies
Maintainers
4
Versions
288
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-cdk/aws-dynamodb - npm Package Compare versions

Comparing version 0.20.0 to 0.21.0

test/integ.dynamodb.ondemand.d.ts

276

lib/dynamodb.generated.d.ts
import cdk = require('@aws-cdk/cdk');
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html
*/
export interface CfnTableProps {
/**
* ``AWS::DynamoDB::Table.KeySchema``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-keyschema
*/
keySchema: Array<CfnTable.KeySchemaProperty | cdk.Token> | cdk.Token;
/**
* ``AWS::DynamoDB::Table.AttributeDefinitions``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-attributedef
*/
attributeDefinitions?: Array<CfnTable.AttributeDefinitionProperty | cdk.Token> | cdk.Token;
/**
* ``AWS::DynamoDB::Table.BillingMode``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-billingmode
*/
billingMode?: string | cdk.Token;
/**
* ``AWS::DynamoDB::Table.GlobalSecondaryIndexes``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-gsi
*/
globalSecondaryIndexes?: Array<CfnTable.GlobalSecondaryIndexProperty | cdk.Token> | cdk.Token;
/**
* ``AWS::DynamoDB::Table.LocalSecondaryIndexes``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-lsi
*/
localSecondaryIndexes?: Array<CfnTable.LocalSecondaryIndexProperty | cdk.Token> | cdk.Token;
/**
* ``AWS::DynamoDB::Table.PointInTimeRecoverySpecification``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-pointintimerecoveryspecification
*/
pointInTimeRecoverySpecification?: CfnTable.PointInTimeRecoverySpecificationProperty | cdk.Token;
/**
* ``AWS::DynamoDB::Table.ProvisionedThroughput``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-provisionedthroughput
*/
provisionedThroughput?: CfnTable.ProvisionedThroughputProperty | cdk.Token;
/**
* ``AWS::DynamoDB::Table.SSESpecification``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-ssespecification
*/
sseSpecification?: CfnTable.SSESpecificationProperty | cdk.Token;
/**
* ``AWS::DynamoDB::Table.StreamSpecification``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-streamspecification
*/
streamSpecification?: CfnTable.StreamSpecificationProperty | cdk.Token;
/**
* ``AWS::DynamoDB::Table.TableName``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-tablename
*/
tableName?: string | cdk.Token;
/**
* ``AWS::DynamoDB::Table.Tags``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-tags
*/
tags?: Array<cdk.Tag | cdk.Token> | cdk.Token;
/**
* ``AWS::DynamoDB::Table.TimeToLiveSpecification``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-timetolivespecification
*/
timeToLiveSpecification?: CfnTable.TimeToLiveSpecificationProperty | cdk.Token;
}
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html
*/
export declare class CfnTable extends cdk.Resource {
/**
* The CloudFormation resource type name for this resource class.
*/
static readonly resourceTypeName = "AWS::DynamoDB::Table";
/**
* @cloudformation_attribute Arn
*/
readonly tableArn: string;
/**
* @cloudformation_attribute StreamArn
*/
readonly tableStreamArn: string;
readonly tableName: string;
/**
* Creates a new ``AWS::DynamoDB::Table``.
*
* @param parent the ``cdk.Construct`` this ``CfnTable`` is a part of
* @param name the name of the resource in the ``cdk.Construct`` tree
* @param properties the properties of this ``CfnTable``
*/
constructor(parent: cdk.Construct, name: string, properties: CfnTableProps);
readonly propertyOverrides: CfnTableProps;
protected renderProperties(properties: any): {
[key: string]: any;
};
}
export declare namespace CfnTable {
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-attributedef.html
*/
interface AttributeDefinitionProperty {
/**
* ``CfnTable.AttributeDefinitionProperty.AttributeName``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-attributedef.html#cfn-dynamodb-attributedef-attributename
*/
attributeName: string | cdk.Token;
/**
* ``CfnTable.AttributeDefinitionProperty.AttributeType``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-attributedef.html#cfn-dynamodb-attributedef-attributename-attributetype
*/
attributeType: string | cdk.Token;
}
}
export declare namespace CfnTable {
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html
*/
interface GlobalSecondaryIndexProperty {
/**
* ``CfnTable.GlobalSecondaryIndexProperty.IndexName``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html#cfn-dynamodb-gsi-indexname
*/
indexName: string | cdk.Token;
/**
* ``CfnTable.GlobalSecondaryIndexProperty.KeySchema``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html#cfn-dynamodb-gsi-keyschema
*/
keySchema: Array<CfnTable.KeySchemaProperty | cdk.Token> | cdk.Token;
/**
* ``CfnTable.GlobalSecondaryIndexProperty.Projection``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html#cfn-dynamodb-gsi-projection
*/
projection: CfnTable.ProjectionProperty | cdk.Token;
/**
* ``CfnTable.GlobalSecondaryIndexProperty.ProvisionedThroughput``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html#cfn-dynamodb-gsi-provisionedthroughput
*/
provisionedThroughput?: CfnTable.ProvisionedThroughputProperty | cdk.Token;
}
}
export declare namespace CfnTable {
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html
*/
interface KeySchemaProperty {
/**
* ``CfnTable.KeySchemaProperty.AttributeName``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html#aws-properties-dynamodb-keyschema-attributename
*/
attributeName: string | cdk.Token;
/**
* ``CfnTable.KeySchemaProperty.KeyType``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html#aws-properties-dynamodb-keyschema-keytype
*/
keyType: string | cdk.Token;
}
}
export declare namespace CfnTable {
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-lsi.html
*/
interface LocalSecondaryIndexProperty {
/**
* ``CfnTable.LocalSecondaryIndexProperty.IndexName``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-lsi.html#cfn-dynamodb-lsi-indexname
*/
indexName: string | cdk.Token;
/**
* ``CfnTable.LocalSecondaryIndexProperty.KeySchema``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-lsi.html#cfn-dynamodb-lsi-keyschema
*/
keySchema: Array<CfnTable.KeySchemaProperty | cdk.Token> | cdk.Token;
/**
* ``CfnTable.LocalSecondaryIndexProperty.Projection``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-lsi.html#cfn-dynamodb-lsi-projection
*/
projection: CfnTable.ProjectionProperty | cdk.Token;
}
}
export declare namespace CfnTable {
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-pointintimerecoveryspecification.html
*/
interface PointInTimeRecoverySpecificationProperty {
/**
* ``CfnTable.PointInTimeRecoverySpecificationProperty.PointInTimeRecoveryEnabled``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-pointintimerecoveryspecification.html#cfn-dynamodb-table-pointintimerecoveryspecification-pointintimerecoveryenabled
*/
pointInTimeRecoveryEnabled?: boolean | cdk.Token;
}
}
export declare namespace CfnTable {
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-projectionobject.html
*/
interface ProjectionProperty {
/**
* ``CfnTable.ProjectionProperty.NonKeyAttributes``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-projectionobject.html#cfn-dynamodb-projectionobj-nonkeyatt
*/
nonKeyAttributes?: Array<string | cdk.Token> | cdk.Token;
/**
* ``CfnTable.ProjectionProperty.ProjectionType``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-projectionobject.html#cfn-dynamodb-projectionobj-projtype
*/
projectionType?: string | cdk.Token;
}
}
export declare namespace CfnTable {
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-provisionedthroughput.html
*/
interface ProvisionedThroughputProperty {
/**
* ``CfnTable.ProvisionedThroughputProperty.ReadCapacityUnits``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-provisionedthroughput.html#cfn-dynamodb-provisionedthroughput-readcapacityunits
*/
readCapacityUnits: number | cdk.Token;
/**
* ``CfnTable.ProvisionedThroughputProperty.WriteCapacityUnits``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-provisionedthroughput.html#cfn-dynamodb-provisionedthroughput-writecapacityunits
*/
writeCapacityUnits: number | cdk.Token;
}
}
export declare namespace CfnTable {
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html
*/
interface SSESpecificationProperty {
/**
* ``CfnTable.SSESpecificationProperty.SSEEnabled``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html#cfn-dynamodb-table-ssespecification-sseenabled
*/
sseEnabled: boolean | cdk.Token;
}
}
export declare namespace CfnTable {
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-streamspecification.html
*/
interface StreamSpecificationProperty {
/**
* ``CfnTable.StreamSpecificationProperty.StreamViewType``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-streamspecification.html#cfn-dynamodb-streamspecification-streamviewtype
*/
streamViewType: string | cdk.Token;
}
}
export declare namespace CfnTable {
/**
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-timetolivespecification.html
*/
interface TimeToLiveSpecificationProperty {
/**
* ``CfnTable.TimeToLiveSpecificationProperty.AttributeName``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-timetolivespecification.html#cfn-dynamodb-timetolivespecification-attributename
*/
attributeName: string | cdk.Token;
/**
* ``CfnTable.TimeToLiveSpecificationProperty.Enabled``
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-timetolivespecification.html#cfn-dynamodb-timetolivespecification-enabled
*/
enabled: boolean | cdk.Token;
}
}
export declare namespace cloudformation {

@@ -69,2 +334,3 @@ /**

/**
* @deprecated "cloudformation.TableResource" will be deprecated in a future release in favor of "CfnTable" (see https://github.com/awslabs/aws-cdk/issues/878)
* @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html

@@ -130,3 +396,3 @@ */

*/
keySchema: Array<KeySchemaProperty | cdk.Token> | cdk.Token;
keySchema: Array<TableResource.KeySchemaProperty | cdk.Token> | cdk.Token;
/**

@@ -136,3 +402,3 @@ * ``TableResource.GlobalSecondaryIndexProperty.Projection``

*/
projection: ProjectionProperty | cdk.Token;
projection: TableResource.ProjectionProperty | cdk.Token;
/**

@@ -142,3 +408,3 @@ * ``TableResource.GlobalSecondaryIndexProperty.ProvisionedThroughput``

*/
provisionedThroughput?: ProvisionedThroughputProperty | cdk.Token;
provisionedThroughput?: TableResource.ProvisionedThroughputProperty | cdk.Token;
}

@@ -177,3 +443,3 @@ }

*/
keySchema: Array<KeySchemaProperty | cdk.Token> | cdk.Token;
keySchema: Array<TableResource.KeySchemaProperty | cdk.Token> | cdk.Token;
/**

@@ -183,3 +449,3 @@ * ``TableResource.LocalSecondaryIndexProperty.Projection``

*/
projection: ProjectionProperty | cdk.Token;
projection: TableResource.ProjectionProperty | cdk.Token;
}

@@ -186,0 +452,0 @@ }

@@ -18,2 +18,5 @@ import iam = require('@aws-cdk/aws-iam');

* those will share the table's provisioned throughput.
*
* Can only be provided if billingMode is Provisioned.
*
* @default 5

@@ -25,2 +28,5 @@ */

* those will share the table's provisioned throughput.
*
* Can only be provided if billingMode is Provisioned.
*
* @default 5

@@ -30,2 +36,7 @@ */

/**
* Specify how you are charged for read and write throughput and how you manage capacity.
* @default Provisioned
*/
billingMode?: BillingMode;
/**
* Enforces a particular physical table name.

@@ -100,2 +111,5 @@ * @default <generated>

* The read capacity for the global secondary index.
*
* Can only be provided if table billingMode is Provisioned or undefined.
*
* @default 5

@@ -106,2 +120,5 @@ */

* The write capacity for the global secondary index.
*
* Can only be provided if table billingMode is Provisioned or undefined.
*
* @default 5

@@ -133,2 +150,3 @@ */

private tableSortKey?;
private readonly billingMode;
private readonly tableScaling;

@@ -226,2 +244,8 @@ private readonly indexScaling;

/**
* Validate read and write capacity are not specified for on-demand tables (billing mode PAY_PER_REQUEST).
*
* @param props read and write capacity properties
*/
private validateProvisioning;
/**
* Validate index name to check if a duplicate name already exists.

@@ -258,2 +282,15 @@ *

}
/**
* DyanmoDB's Read/Write capacity modes.
*/
export declare enum BillingMode {
/**
* Pay only for what you use. You don't configure Read/Write capacity units.
*/
PayPerRequest = "PAY_PER_REQUEST",
/**
* Explicitly specified Read/Write capacity units.
*/
Provisioned = "PROVISIONED"
}
export declare enum ProjectionType {

@@ -260,0 +297,0 @@ KeysOnly = "KEYS_ONLY",

27

package.json
{
"name": "@aws-cdk/aws-dynamodb",
"version": "0.20.0",
"version": "0.21.0",
"description": "CDK Constructs for AWS DynamoDB",

@@ -55,19 +55,22 @@ "main": "lib/index.js",

"devDependencies": {
"@aws-cdk/assert": "^0.20.0",
"cdk-build-tools": "^0.20.0",
"cdk-integ-tools": "^0.20.0",
"cfn2ts": "^0.20.0",
"pkglint": "^0.20.0"
"@aws-cdk/assert": "^0.21.0",
"cdk-build-tools": "^0.21.0",
"cdk-integ-tools": "^0.21.0",
"cfn2ts": "^0.21.0",
"pkglint": "^0.21.0"
},
"dependencies": {
"@aws-cdk/aws-applicationautoscaling": "^0.20.0",
"@aws-cdk/aws-iam": "^0.20.0",
"@aws-cdk/cdk": "^0.20.0"
"@aws-cdk/aws-applicationautoscaling": "^0.21.0",
"@aws-cdk/aws-iam": "^0.21.0",
"@aws-cdk/cdk": "^0.21.0"
},
"homepage": "https://github.com/awslabs/aws-cdk",
"peerDependencies": {
"@aws-cdk/aws-applicationautoscaling": "^0.20.0",
"@aws-cdk/aws-iam": "^0.20.0",
"@aws-cdk/cdk": "^0.20.0"
"@aws-cdk/aws-applicationautoscaling": "^0.21.0",
"@aws-cdk/aws-iam": "^0.21.0",
"@aws-cdk/cdk": "^0.21.0"
},
"engines": {
"node": ">= 8.10.0"
}
}

@@ -18,2 +18,20 @@ ## AWS DynamoDB Construct Library

### Billing Mode
DynamoDB supports two billing modes:
* PROVISIONED - the default mode where the table and global secondary indexes have configured read and write capacity.
* PAY_PER_REQUEST - on-demand pricing and scaling. You only pay for what you use and there is no read and write capacity for the table or its gloal secondary indexes.
```ts
import dynamodb = require('@aws-cdk/aws-dynamodb');
const table = new dynamodb.Table(stack, 'Table', {
partitionKey: { name: 'id', type: dynamodb.AttributeType.String },
billingMode: dynamodb.BillingMode.PayPerRequest
});
```
Further reading:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.
### Configure AutoScaling for your table

@@ -26,2 +44,4 @@

Auto-scaling is only relevant for tables with the billing mode, PROVISIONED.
[Example of configuring autoscaling](test/integ.autoscaling.lit.ts)

@@ -31,2 +51,2 @@

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/
https://aws.amazon.com/blogs/database/how-to-use-aws-cloudformation-to-configure-auto-scaling-for-amazon-dynamodb-tables-and-indexes/

@@ -17,2 +17,4 @@ import { Test } from 'nodeunit';

'when specifying every property'(test: Test): void;
'when specifying PAY_PER_REQUEST billing mode'(test: Test): void;
'error when specifying read or write capacity with a PAY_PER_REQUEST billing mode'(test: Test): void;
'when adding a global secondary index with hash key only'(test: Test): void;

@@ -22,2 +24,3 @@ 'when adding a global secondary index with hash + range key'(test: Test): void;

'when adding a global secondary index with projection type INCLUDE'(test: Test): void;
'when adding a global secondary index on a table with PAY_PER_REQUEST billing mode'(test: Test): void;
'error when adding a global secondary index with projection type INCLUDE, but without specifying non-key attributes'(test: Test): void;

@@ -28,2 +31,3 @@ 'error when adding a global secondary index with projection type ALL, but with non-key attributes'(test: Test): void;

'error when adding a global secondary index with projection type INCLUDE, but with key attributes'(test: Test): void;
'error when adding a global secondary index with read or write capacity on a PAY_PER_REQUEST table'(test: Test): void;
'when adding multiple global secondary indexes'(test: Test): void;

@@ -42,2 +46,3 @@ 'error when adding more than 5 global secondary indexes'(test: Test): void;

'cannot enable AutoScaling twice on the same property'(test: Test): void;
'error when enabling AutoScaling on the PAY_PER_REQUEST table'(test: Test): void;
'error when specifying Read Auto Scaling with invalid scalingTargetValue < 10'(test: Test): void;

@@ -44,0 +49,0 @@ 'error when specifying Read Auto Scaling with invalid minimumCapacity'(test: Test): void;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc