dynamodb

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-aws repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-aws repo.

class pulumi_aws.dynamodb.AwaitableGetTableResult(arn=None, attributes=None, billing_mode=None, global_secondary_indexes=None, hash_key=None, local_secondary_indexes=None, name=None, point_in_time_recovery=None, range_key=None, read_capacity=None, server_side_encryption=None, stream_arn=None, stream_enabled=None, stream_label=None, stream_view_type=None, tags=None, ttl=None, write_capacity=None, id=None)
class pulumi_aws.dynamodb.GetTableResult(arn=None, attributes=None, billing_mode=None, global_secondary_indexes=None, hash_key=None, local_secondary_indexes=None, name=None, point_in_time_recovery=None, range_key=None, read_capacity=None, server_side_encryption=None, stream_arn=None, stream_enabled=None, stream_label=None, stream_view_type=None, tags=None, ttl=None, write_capacity=None, id=None)

A collection of values returned by getTable.

id = None

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

class pulumi_aws.dynamodb.GlobalTable(resource_name, opts=None, name=None, replicas=None, __props__=None, __name__=None, __opts__=None)

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.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • name (pulumi.Input[str]) – The name of the global table. Must match underlying DynamoDB Table names in all regions.

  • replicas (pulumi.Input[list]) – Underlying DynamoDB Table. At least 1 replica must be defined. See below.

The replicas object supports the following:

  • regionName (pulumi.Input[str]) - AWS region name of replica DynamoDB Table. e.g. us-east-1

arn = None

The ARN of the DynamoDB Global Table

name = None

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

replicas = None

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

  • regionName (str) - AWS region name of replica DynamoDB Table. e.g. us-east-1

static get(resource_name, id, opts=None, arn=None, name=None, replicas=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • arn (pulumi.Input[str]) – The ARN of the DynamoDB Global Table

  • name (pulumi.Input[str]) – The name of the global table. Must match underlying DynamoDB Table names in all regions.

  • replicas (pulumi.Input[list]) – Underlying DynamoDB Table. At least 1 replica must be defined. See below.

The replicas object supports the following:

  • regionName (pulumi.Input[str]) - AWS region name of replica DynamoDB Table. e.g. us-east-1

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.dynamodb.Table(resource_name, opts=None, attributes=None, billing_mode=None, global_secondary_indexes=None, hash_key=None, local_secondary_indexes=None, name=None, point_in_time_recovery=None, range_key=None, read_capacity=None, server_side_encryption=None, stream_enabled=None, stream_view_type=None, tags=None, ttl=None, write_capacity=None, __props__=None, __name__=None, __opts__=None)

Provides a DynamoDB table resource

Note: It is recommended to use lifecycle ``ignore_changes` <https://www.terraform.io/docs/configuration/resources.html#ignore_changes>`_ for read_capacity and/or write_capacity if there’s autoscaling policy attached to the table.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • attributes (pulumi.Input[list]) – List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:

  • billing_mode (pulumi.Input[str]) – Controls how you are charged for read and write throughput and how you manage capacity. The valid values are PROVISIONED and PAY_PER_REQUEST. Defaults to PROVISIONED.

  • global_secondary_indexes (pulumi.Input[list]) – Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.

  • hash_key (pulumi.Input[str]) – The name of the hash key in the index; must be defined as an attribute in the resource.

  • local_secondary_indexes (pulumi.Input[list]) – 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.

  • name (pulumi.Input[str]) – The name of the index

  • point_in_time_recovery (pulumi.Input[dict]) – Point-in-time recovery options.

  • range_key (pulumi.Input[str]) – The name of the range key; must be defined

  • read_capacity (pulumi.Input[float]) – The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.

  • server_side_encryption (pulumi.Input[dict]) – Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn’t specified.

  • stream_enabled (pulumi.Input[bool]) – Indicates whether Streams are to be enabled (true) or disabled (false).

  • stream_view_type (pulumi.Input[str]) – 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.

  • tags (pulumi.Input[dict]) – A map of tags to populate on the created table.

  • ttl (pulumi.Input[dict]) – Defines ttl, has two properties, and can only be specified once:

  • write_capacity (pulumi.Input[float]) – The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.

The attributes object supports the following:

  • name (pulumi.Input[str]) - The name of the index

  • type (pulumi.Input[str]) - Attribute type, which must be a scalar type: S, N, or B for (S)tring, (N)umber or (B)inary data

The global_secondary_indexes object supports the following:

  • hash_key (pulumi.Input[str]) - The name of the hash key in the index; must be defined as an attribute in the resource.

  • name (pulumi.Input[str]) - The name of the index

  • nonKeyAttributes (pulumi.Input[list]) - Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.

  • projectionType (pulumi.Input[str]) - One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the _non_keyattributes parameter.

  • range_key (pulumi.Input[str]) - The name of the range key; must be defined

  • read_capacity (pulumi.Input[float]) - The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.

  • write_capacity (pulumi.Input[float]) - The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.

The local_secondary_indexes object supports the following:

  • name (pulumi.Input[str]) - The name of the index

  • nonKeyAttributes (pulumi.Input[list]) - Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.

  • projectionType (pulumi.Input[str]) - One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the _non_keyattributes parameter.

  • range_key (pulumi.Input[str]) - The name of the range key; must be defined

The point_in_time_recovery object supports the following:

  • enabled (pulumi.Input[bool]) - Whether to enable point-in-time recovery - note that it can take up to 10 minutes to enable for new tables. If the point_in_time_recovery block is not provided then this defaults to false.

The server_side_encryption object supports the following:

  • enabled (pulumi.Input[bool]) - Whether to enable point-in-time recovery - note that it can take up to 10 minutes to enable for new tables. If the point_in_time_recovery block is not provided then this defaults to false.

The ttl object supports the following:

  • attributeName (pulumi.Input[str]) - The name of the table attribute to store the TTL timestamp in.

  • enabled (pulumi.Input[bool]) - Whether to enable point-in-time recovery - note that it can take up to 10 minutes to enable for new tables. If the point_in_time_recovery block is not provided then this defaults to false.

arn = None

The arn of the table

attributes = None

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

  • name (str) - The name of the index

  • type (str) - Attribute type, which must be a scalar type: S, N, or B for (S)tring, (N)umber or (B)inary data

billing_mode = None

Controls how you are charged for read and write throughput and how you manage capacity. The valid values are PROVISIONED and PAY_PER_REQUEST. Defaults to PROVISIONED.

global_secondary_indexes = None

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

  • hash_key (str) - The name of the hash key in the index; must be defined as an attribute in the resource.

  • name (str) - The name of the index

  • nonKeyAttributes (list) - Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.

  • projectionType (str) - One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the _non_keyattributes parameter.

  • range_key (str) - The name of the range key; must be defined

  • read_capacity (float) - The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.

  • write_capacity (float) - The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.

hash_key = None

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

local_secondary_indexes = None

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.

  • name (str) - The name of the index

  • nonKeyAttributes (list) - Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.

  • projectionType (str) - One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the _non_keyattributes parameter.

  • range_key (str) - The name of the range key; must be defined

name = None

The name of the index

point_in_time_recovery = None

Point-in-time recovery options.

  • enabled (bool) - Whether to enable point-in-time recovery - note that it can take up to 10 minutes to enable for new tables. If the point_in_time_recovery block is not provided then this defaults to false.

range_key = None

The name of the range key; must be defined

read_capacity = None

The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.

server_side_encryption = None

Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn’t specified.

  • enabled (bool) - Whether to enable point-in-time recovery - note that it can take up to 10 minutes to enable for new tables. If the point_in_time_recovery block is not provided then this defaults to false.

stream_arn = None

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

stream_enabled = None

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

stream_label = None

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

stream_view_type = None

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.

tags = None

A map of tags to populate on the created table.

ttl = None

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

  • attributeName (str) - The name of the table attribute to store the TTL timestamp in.

  • enabled (bool) - Whether to enable point-in-time recovery - note that it can take up to 10 minutes to enable for new tables. If the point_in_time_recovery block is not provided then this defaults to false.

write_capacity = None

The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.

static get(resource_name, id, opts=None, arn=None, attributes=None, billing_mode=None, global_secondary_indexes=None, hash_key=None, local_secondary_indexes=None, name=None, point_in_time_recovery=None, range_key=None, read_capacity=None, server_side_encryption=None, stream_arn=None, stream_enabled=None, stream_label=None, stream_view_type=None, tags=None, ttl=None, write_capacity=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • arn (pulumi.Input[str]) – The arn of the table

  • attributes (pulumi.Input[list]) – List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:

  • billing_mode (pulumi.Input[str]) – Controls how you are charged for read and write throughput and how you manage capacity. The valid values are PROVISIONED and PAY_PER_REQUEST. Defaults to PROVISIONED.

  • global_secondary_indexes (pulumi.Input[list]) – Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.

  • hash_key (pulumi.Input[str]) – The name of the hash key in the index; must be defined as an attribute in the resource.

  • local_secondary_indexes (pulumi.Input[list]) – 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.

  • name (pulumi.Input[str]) – The name of the index

  • point_in_time_recovery (pulumi.Input[dict]) – Point-in-time recovery options.

  • range_key (pulumi.Input[str]) – The name of the range key; must be defined

  • read_capacity (pulumi.Input[float]) – The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.

  • server_side_encryption (pulumi.Input[dict]) – Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn’t specified.

  • stream_arn (pulumi.Input[str]) – The ARN of the Table Stream. Only available when stream_enabled = true

  • stream_enabled (pulumi.Input[bool]) – Indicates whether Streams are to be enabled (true) or disabled (false).

  • stream_label (pulumi.Input[str]) – 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

  • stream_view_type (pulumi.Input[str]) – 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.

  • tags (pulumi.Input[dict]) – A map of tags to populate on the created table.

  • ttl (pulumi.Input[dict]) – Defines ttl, has two properties, and can only be specified once:

  • write_capacity (pulumi.Input[float]) – The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.

The attributes object supports the following:

  • name (pulumi.Input[str]) - The name of the index

  • type (pulumi.Input[str]) - Attribute type, which must be a scalar type: S, N, or B for (S)tring, (N)umber or (B)inary data

The global_secondary_indexes object supports the following:

  • hash_key (pulumi.Input[str]) - The name of the hash key in the index; must be defined as an attribute in the resource.

  • name (pulumi.Input[str]) - The name of the index

  • nonKeyAttributes (pulumi.Input[list]) - Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.

  • projectionType (pulumi.Input[str]) - One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the _non_keyattributes parameter.

  • range_key (pulumi.Input[str]) - The name of the range key; must be defined

  • read_capacity (pulumi.Input[float]) - The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.

  • write_capacity (pulumi.Input[float]) - The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.

The local_secondary_indexes object supports the following:

  • name (pulumi.Input[str]) - The name of the index

  • nonKeyAttributes (pulumi.Input[list]) - Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.

  • projectionType (pulumi.Input[str]) - One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the _non_keyattributes parameter.

  • range_key (pulumi.Input[str]) - The name of the range key; must be defined

The point_in_time_recovery object supports the following:

  • enabled (pulumi.Input[bool]) - Whether to enable point-in-time recovery - note that it can take up to 10 minutes to enable for new tables. If the point_in_time_recovery block is not provided then this defaults to false.

The server_side_encryption object supports the following:

  • enabled (pulumi.Input[bool]) - Whether to enable point-in-time recovery - note that it can take up to 10 minutes to enable for new tables. If the point_in_time_recovery block is not provided then this defaults to false.

The ttl object supports the following:

  • attributeName (pulumi.Input[str]) - The name of the table attribute to store the TTL timestamp in.

  • enabled (pulumi.Input[bool]) - Whether to enable point-in-time recovery - note that it can take up to 10 minutes to enable for new tables. If the point_in_time_recovery block is not provided then this defaults to false.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.dynamodb.TableItem(resource_name, opts=None, hash_key=None, item=None, range_key=None, table_name=None, __props__=None, __name__=None, __opts__=None)

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.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • hash_key (pulumi.Input[str]) – Hash key to use for lookups and identification of the item

  • item (pulumi.Input[str]) – 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.

  • range_key (pulumi.Input[str]) – Range key to use for lookups and identification of the item. Required if there is range key defined in the table.

  • table_name (pulumi.Input[str]) – The name of the table to contain the item.

hash_key = None

Hash key to use for lookups and identification of the item

item = None

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.

range_key = None

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

table_name = None

The name of the table to contain the item.

static get(resource_name, id, opts=None, hash_key=None, item=None, range_key=None, table_name=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • hash_key (pulumi.Input[str]) – Hash key to use for lookups and identification of the item

  • item (pulumi.Input[str]) – 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.

  • range_key (pulumi.Input[str]) – Range key to use for lookups and identification of the item. Required if there is range key defined in the table.

  • table_name (pulumi.Input[str]) – The name of the table to contain the item.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

pulumi_aws.dynamodb.get_table(name=None, server_side_encryption=None, tags=None, opts=None)

Provides information about a DynamoDB table.

Parameters

name (str) – The name of the DynamoDB table.

The server_side_encryption object supports the following:

  • enabled (bool)