Module library

DynamoDB

Terraform module to create AWS DynamoDB resources

Inputs

39
attributesoptionallist(map(string))

List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties: name - (Required) The name of the attribute, type - (Required) Attribute type, which must be a scalar type: S, N, or B for (S)tring, (N)umber or (B)inary data

Default[]
autoscaling_defaultsoptionalmap(string)

A map of default autoscaling settings

Default{…}
autoscaling_enabledoptionalbool

Whether or not to enable autoscaling. See note in README about this setting

Defaultfalse
autoscaling_indexesoptionalmap(map(string))

A map of index autoscaling configurations. See example in examples/autoscaling

Default{}
autoscaling_readoptionalmap(string)

A map of read autoscaling settings. `max_capacity` is the only required key. See example in examples/autoscaling

Default{}
autoscaling_writeoptionalmap(string)

A map of write autoscaling settings. `max_capacity` is the only required key. See example in examples/autoscaling

Default{}
billing_modeoptionalstring

Controls how you are billed for read/write throughput and how you manage capacity. The valid values are PROVISIONED or PAY_PER_REQUEST

DefaultPAY_PER_REQUEST
create_tableoptionalbool

Controls if DynamoDB table and associated resources are created

Defaulttrue
deletion_protection_enabledoptionalbool

Enables deletion protection for table

Defaultnull
global_secondary_indexesoptionalany

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

Default[]
global_table_witnessoptionalobject({ region_name = optional(string) })

Witness Region in a Multi-Region Strong Consistency deployment. Note This must be used alongside a single replica with consistency_mode set to STRONG. Other combinations will fail to provision

Defaultnull
hash_keyoptionalstring

The attribute to use as the hash (partition) key. Must also be defined as an attribute

Defaultnull
ignore_changes_global_secondary_indexoptionalbool

Whether to ignore changes lifecycle to global secondary indices, useful for provisioned tables with scaling

Defaultfalse
import_tableoptionalany

Configurations for importing s3 data into a new table.

Default{}
local_secondary_indexesoptionalany

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.

Default[]
nameoptionalstring

Name of the DynamoDB table

Defaultnull
on_demand_throughputoptionalany

Sets the maximum number of read and write units for the specified on-demand table

Default{}
point_in_time_recovery_enabledoptionalbool

Whether to enable point-in-time recovery

Defaultfalse
point_in_time_recovery_period_in_daysoptionalnumber

Number of preceding days for which continuous backups are taken and maintained. Default 35

Defaultnull
range_keyoptionalstring

The attribute to use as the range (sort) key. Must also be defined as an attribute

Defaultnull
read_capacityoptionalnumber

The number of read units for this table. If the billing_mode is PROVISIONED, this field should be greater than 0

Defaultnull
regionoptionalstring

Region where this resource will be managed. Defaults to the Region set in the provider configuration

Defaultnull
replica_regionsoptionalany

Region names for creating replicas for a global DynamoDB table.

Default[]
resource_policyoptionalstring

The JSON definition of the resource-based policy.

Defaultnull
restore_date_timeoptionalstring

Time of the point-in-time recovery point to restore.

Defaultnull
restore_source_nameoptionalstring

Name of the table to restore. Must match the name of an existing table.

Defaultnull
restore_source_table_arnoptionalstring

ARN of the source table to restore. Must be supplied for cross-region restores.

Defaultnull
restore_to_latest_timeoptionalbool

If set, restores table to the most recent point-in-time recovery point.

Defaultnull
server_side_encryption_enabledoptionalbool

Whether or not to enable encryption at rest using an AWS managed KMS customer master key (CMK)

Defaultfalse
server_side_encryption_kms_key_arnoptionalstring

The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.

Defaultnull
stream_enabledoptionalbool

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

Defaultfalse
stream_view_typeoptionalstring

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.

Defaultnull
table_classoptionalstring

The storage class of the table. Valid values are STANDARD and STANDARD_INFREQUENT_ACCESS

Defaultnull
tagsoptionalmap(string)

A map of tags to add to all resources

Default{}
timeoutsoptionalmap(string)

Updated Terraform resource management timeouts

Default{…}
ttl_attribute_nameoptionalstring

The name of the table attribute to store the TTL timestamp in

Default""
ttl_enabledoptionalbool

Indicates whether ttl is enabled

Defaultfalse
warm_throughputoptionalany

Sets the number of warm read and write units for the specified table

Default{}
write_capacityoptionalnumber

The number of write units for this table. If the billing_mode is PROVISIONED, this field should be greater than 0

Defaultnull

All 39 are optional — the module deploys with none of them set.

Outputs

8
dynamodb_table_arn

ARN of the DynamoDB table

dynamodb_table_id

ID of the DynamoDB table

dynamodb_table_replica_arns

Map of the Table replicas ARNs

dynamodb_table_replica_stream_arns

Map of the Table replicas stream ARNs

dynamodb_table_replica_stream_labels

Map of the timestamps of the Table replicas stream

dynamodb_table_replicas

Map of Table replicas by region

dynamodb_table_stream_arn

The ARN of the Table Stream

dynamodb_table_stream_label

A timestamp, in ISO 8601 format of the Table Stream

What the agent wires into the next module. An edge on the architecture diagram is one of these consumed by something else.