Fork me on GitHub

Module dynamodb

@pulumi/aws > dynamodb

Index

dynamodb/dynamodbMixins.ts dynamodb/getTable.ts dynamodb/globalTable.ts dynamodb/table.ts dynamodb/tableItem.ts

class GlobalTable

Provides a resource to manage a DynamoDB Global Table. These are layered on top of existing DynamoDB Tables.

~> Note: There are many restrictions before you can properly create DynamoDB Global Tables in multiple regions. See the AWS DynamoDB Global Table Requirements for more information.

constructor

new GlobalTable(name: string, args: GlobalTableArgs, opts?: pulumi.CustomResourceOptions)

Create a GlobalTable resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: GlobalTableState): GlobalTable

Get an existing GlobalTable resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The ARN of the DynamoDB Global Table

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the global table. Must match underlying DynamoDB Table names in all regions.

property replicas

public replicas: pulumi.Output<{ ... }[]>;

Underlying DynamoDB Table. At least 1 replica must be defined. See below.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Table

Provides a DynamoDB table resource

~> Note: It is recommended to use lifecycle ignore_changes for read_capacity and/or write_capacity if there’s autoscaling policy attached to the table.

constructor

new Table(name: string, args: TableArgs, opts?: pulumi.CustomResourceOptions)

Create a Table resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TableState): Table

Get an existing Table resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The arn of the table

property attributes

public attributes: pulumi.Output<{ ... }[]>;

List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:

property globalSecondaryIndexes

public globalSecondaryIndexes: pulumi.Output<{ ... }[] | undefined>;

Describe a GSO for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.

property hashKey

public hashKey: pulumi.Output<string>;

The name of the hash key in the index; must be defined as an attribute in the resource.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property localSecondaryIndexes

public localSecondaryIndexes: pulumi.Output<{ ... }[] | undefined>;

Describe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.

property name

public name: pulumi.Output<string>;

The name of the index

property pointInTimeRecovery

public pointInTimeRecovery: pulumi.Output<{ ... }>;

Point-in-time recovery options.

property rangeKey

public rangeKey: pulumi.Output<string | undefined>;

The name of the range key; must be defined

property readCapacity

public readCapacity: pulumi.Output<number>;

The number of read units for this index

property serverSideEncryption

public serverSideEncryption: pulumi.Output<{ ... }>;

Encrypt at rest options.

property streamArn

public streamArn: pulumi.Output<string>;

The ARN of the Table Stream. Only available when stream_enabled = true

property streamEnabled

public streamEnabled: pulumi.Output<boolean | undefined>;

Indicates whether Streams are to be enabled (true) or disabled (false).

property streamLabel

public streamLabel: pulumi.Output<string>;

A timestamp, in ISO 8601 format, for this stream. Note that this timestamp is not a unique identifier for the stream on its own. However, the combination of AWS customer ID, table name and this field is guaranteed to be unique. It can be used for creating CloudWatch Alarms. Only available when stream_enabled = true

property streamViewType

public streamViewType: pulumi.Output<string>;

When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES.

property tags

public tags: pulumi.Output<{ ... } | undefined>;

A map of tags to populate on the created table.

property ttl

public ttl: pulumi.Output<{ ... } | undefined>;

Defines ttl, has two properties, and can only be specified once:

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property writeCapacity

public writeCapacity: pulumi.Output<number>;

The number of write units for this index

class TableEventSubscription

constructor

new TableEventSubscription(name: string, table: table.Table, handler: TableEventHandler, args: TableEventSubscriptionArgs, opts?: pulumi.ResourceOptions)

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

method registerOutputs

protected registerOutputs(outputs: Inputs | Promise<Inputs> | Output<Inputs> | undefined): void

property eventSourceMapping

public eventSourceMapping: lambda.EventSourceMapping;

property func

public func: LambdaFunction;

property permission

public permission: permission.Permission;

property table

public table: pulumi.Output<table.Table>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class TableItem

Provides a DynamoDB table item resource

-> Note: This resource is not meant to be used for managing large amounts of data in your table, it is not designed to scale. You should perform regular backups of all data in the table, see AWS docs for more.

constructor

new TableItem(name: string, args: TableItemArgs, opts?: pulumi.CustomResourceOptions)

Create a TableItem resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TableItemState): TableItem

Get an existing TableItem resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property hashKey

public hashKey: pulumi.Output<string>;

Hash key to use for lookups and identification of the item

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property item

public item: pulumi.Output<string>;

JSON representation of a map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.

property rangeKey

public rangeKey: pulumi.Output<string | undefined>;

Range key to use for lookups and identification of the item. Required if there is range key defined in the table.

property tableName

public tableName: pulumi.Output<string>;

The name of the table to contain the item.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

function getTable

getTable(args: GetTableArgs, opts?: pulumi.InvokeOptions): Promise<GetTableResult>

Provides information about a DynamoDB table.

interface GetTableArgs

A collection of arguments for invoking getTable.

property name

name: string;

The name of the DynamoDB table.

property serverSideEncryption

serverSideEncryption?: { ... };

property tags

tags?: { ... };

interface GetTableResult

A collection of values returned by getTable.

property arn

arn: string;

property attributes

attributes: { ... }[];

property globalSecondaryIndexes

globalSecondaryIndexes: { ... }[];

property hashKey

hashKey: string;

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property localSecondaryIndexes

localSecondaryIndexes: { ... }[];

property rangeKey

rangeKey: string;

property readCapacity

readCapacity: number;

property serverSideEncryption

serverSideEncryption: { ... };

property streamArn

streamArn: string;

property streamEnabled

streamEnabled: boolean;

property streamLabel

streamLabel: string;

property streamViewType

streamViewType: string;

property tags

tags: { ... };

property ttl

ttl: { ... };

property writeCapacity

writeCapacity: number;

interface GlobalTableArgs

The set of arguments for constructing a GlobalTable resource.

property name

name?: pulumi.Input<string>;

The name of the global table. Must match underlying DynamoDB Table names in all regions.

property replicas

replicas: pulumi.Input<pulumi.Input<{ ... }>[]>;

Underlying DynamoDB Table. At least 1 replica must be defined. See below.

interface GlobalTableState

Input properties used for looking up and filtering GlobalTable resources.

property arn

arn?: pulumi.Input<string>;

The ARN of the DynamoDB Global Table

property name

name?: pulumi.Input<string>;

The name of the global table. Must match underlying DynamoDB Table names in all regions.

property replicas

replicas?: pulumi.Input<pulumi.Input<{ ... }>[]>;

Underlying DynamoDB Table. At least 1 replica must be defined. See below.

interface TableArgs

The set of arguments for constructing a Table resource.

property attributes

attributes: pulumi.Input<pulumi.Input<{ ... }>[]>;

List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:

property globalSecondaryIndexes

globalSecondaryIndexes?: pulumi.Input<pulumi.Input<{ ... }>[]>;

Describe a GSO for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.

property hashKey

hashKey: pulumi.Input<string>;

The name of the hash key in the index; must be defined as an attribute in the resource.

property localSecondaryIndexes

localSecondaryIndexes?: pulumi.Input<pulumi.Input<{ ... }>[]>;

Describe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.

property name

name?: pulumi.Input<string>;

The name of the index

property pointInTimeRecovery

pointInTimeRecovery?: pulumi.Input<{ ... }>;

Point-in-time recovery options.

property rangeKey

rangeKey?: pulumi.Input<string>;

The name of the range key; must be defined

property readCapacity

readCapacity: pulumi.Input<number>;

The number of read units for this index

property serverSideEncryption

serverSideEncryption?: pulumi.Input<{ ... }>;

Encrypt at rest options.

property streamEnabled

streamEnabled?: pulumi.Input<boolean>;

Indicates whether Streams are to be enabled (true) or disabled (false).

property streamViewType

streamViewType?: pulumi.Input<string>;

When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES.

property tags

tags?: pulumi.Input<{ ... }>;

A map of tags to populate on the created table.

property ttl

ttl?: pulumi.Input<{ ... }>;

Defines ttl, has two properties, and can only be specified once:

property writeCapacity

writeCapacity: pulumi.Input<number>;

The number of write units for this index

interface TableEvent

property Records

Records: TableEventRecord[];

interface TableEventRecord

property awsRegion

awsRegion: string;

property dynamodb

dynamodb: { ... };

property eventID

eventID: string;

property eventName

eventName: INSERT | MODIFY | REMOVE;

property eventSource

eventSource: string;

property eventVersion

eventVersion: string;

property userIdentity

userIdentity: { ... };

interface TableEventSubscriptionArgs

Arguments to control the event rule subscription. Currently empty, but still defined in case of future need.

property batchSize

batchSize?: number;

The largest number of records that Lambda will retrieve from your event source at the time of invocation. Defaults to 100 for DynamoDB.

property startingPosition

startingPosition: TRIM_HORIZON | LATEST;

The position in the stream where AWS Lambda should start reading. Must be one of either TRIM_HORIZON or LATEST.

interface TableItemArgs

The set of arguments for constructing a TableItem resource.

property hashKey

hashKey: pulumi.Input<string>;

Hash key to use for lookups and identification of the item

property item

item: pulumi.Input<string>;

JSON representation of a map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.

property rangeKey

rangeKey?: pulumi.Input<string>;

Range key to use for lookups and identification of the item. Required if there is range key defined in the table.

property tableName

tableName: pulumi.Input<string>;

The name of the table to contain the item.

interface TableItemState

Input properties used for looking up and filtering TableItem resources.

property hashKey

hashKey?: pulumi.Input<string>;

Hash key to use for lookups and identification of the item

property item

item?: pulumi.Input<string>;

JSON representation of a map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.

property rangeKey

rangeKey?: pulumi.Input<string>;

Range key to use for lookups and identification of the item. Required if there is range key defined in the table.

property tableName

tableName?: pulumi.Input<string>;

The name of the table to contain the item.

interface TableState

Input properties used for looking up and filtering Table resources.

property arn

arn?: pulumi.Input<string>;

The arn of the table

property attributes

attributes?: pulumi.Input<pulumi.Input<{ ... }>[]>;

List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:

property globalSecondaryIndexes

globalSecondaryIndexes?: pulumi.Input<pulumi.Input<{ ... }>[]>;

Describe a GSO for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.

property hashKey

hashKey?: pulumi.Input<string>;

The name of the hash key in the index; must be defined as an attribute in the resource.

property localSecondaryIndexes

localSecondaryIndexes?: pulumi.Input<pulumi.Input<{ ... }>[]>;

Describe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.

property name

name?: pulumi.Input<string>;

The name of the index

property pointInTimeRecovery

pointInTimeRecovery?: pulumi.Input<{ ... }>;

Point-in-time recovery options.

property rangeKey

rangeKey?: pulumi.Input<string>;

The name of the range key; must be defined

property readCapacity

readCapacity?: pulumi.Input<number>;

The number of read units for this index

property serverSideEncryption

serverSideEncryption?: pulumi.Input<{ ... }>;

Encrypt at rest options.

property streamArn

streamArn?: pulumi.Input<string>;

The ARN of the Table Stream. Only available when stream_enabled = true

property streamEnabled

streamEnabled?: pulumi.Input<boolean>;

Indicates whether Streams are to be enabled (true) or disabled (false).

property streamLabel

streamLabel?: pulumi.Input<string>;

A timestamp, in ISO 8601 format, for this stream. Note that this timestamp is not a unique identifier for the stream on its own. However, the combination of AWS customer ID, table name and this field is guaranteed to be unique. It can be used for creating CloudWatch Alarms. Only available when stream_enabled = true

property streamViewType

streamViewType?: pulumi.Input<string>;

When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES.

property tags

tags?: pulumi.Input<{ ... }>;

A map of tags to populate on the created table.

property ttl

ttl?: pulumi.Input<{ ... }>;

Defines ttl, has two properties, and can only be specified once:

property writeCapacity

writeCapacity?: pulumi.Input<number>;

The number of write units for this index

type TableEventHandler

type TableEventHandler = lambda.EventHandler<TableEvent, void>;