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
[]autoscaling_defaultsoptionalmap(string)A map of default autoscaling settings
{…}autoscaling_enabledoptionalboolWhether or not to enable autoscaling. See note in README about this setting
falseautoscaling_indexesoptionalmap(map(string))A map of index autoscaling configurations. See example in examples/autoscaling
{}autoscaling_readoptionalmap(string)A map of read autoscaling settings. `max_capacity` is the only required key. See example in examples/autoscaling
{}autoscaling_writeoptionalmap(string)A map of write autoscaling settings. `max_capacity` is the only required key. See example in examples/autoscaling
{}billing_modeoptionalstringControls how you are billed for read/write throughput and how you manage capacity. The valid values are PROVISIONED or PAY_PER_REQUEST
PAY_PER_REQUESTcreate_tableoptionalboolControls if DynamoDB table and associated resources are created
truedeletion_protection_enabledoptionalboolEnables deletion protection for table
nullglobal_secondary_indexesoptionalanyDescribe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.
[]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
nullhash_keyoptionalstringThe attribute to use as the hash (partition) key. Must also be defined as an attribute
nullignore_changes_global_secondary_indexoptionalboolWhether to ignore changes lifecycle to global secondary indices, useful for provisioned tables with scaling
falseimport_tableoptionalanyConfigurations for importing s3 data into a new table.
{}local_secondary_indexesoptionalanyDescribe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.
[]nameoptionalstringName of the DynamoDB table
nullon_demand_throughputoptionalanySets the maximum number of read and write units for the specified on-demand table
{}point_in_time_recovery_enabledoptionalboolWhether to enable point-in-time recovery
falsepoint_in_time_recovery_period_in_daysoptionalnumberNumber of preceding days for which continuous backups are taken and maintained. Default 35
nullrange_keyoptionalstringThe attribute to use as the range (sort) key. Must also be defined as an attribute
nullread_capacityoptionalnumberThe number of read units for this table. If the billing_mode is PROVISIONED, this field should be greater than 0
nullregionoptionalstringRegion where this resource will be managed. Defaults to the Region set in the provider configuration
nullreplica_regionsoptionalanyRegion names for creating replicas for a global DynamoDB table.
[]resource_policyoptionalstringThe JSON definition of the resource-based policy.
nullrestore_date_timeoptionalstringTime of the point-in-time recovery point to restore.
nullrestore_source_nameoptionalstringName of the table to restore. Must match the name of an existing table.
nullrestore_source_table_arnoptionalstringARN of the source table to restore. Must be supplied for cross-region restores.
nullrestore_to_latest_timeoptionalboolIf set, restores table to the most recent point-in-time recovery point.
nullserver_side_encryption_enabledoptionalboolWhether or not to enable encryption at rest using an AWS managed KMS customer master key (CMK)
falseserver_side_encryption_kms_key_arnoptionalstringThe 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.
nullstream_enabledoptionalboolIndicates whether Streams are to be enabled (true) or disabled (false).
falsestream_view_typeoptionalstringWhen 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.
nulltable_classoptionalstringThe storage class of the table. Valid values are STANDARD and STANDARD_INFREQUENT_ACCESS
nulltagsoptionalmap(string)A map of tags to add to all resources
{}timeoutsoptionalmap(string)Updated Terraform resource management timeouts
{…}ttl_attribute_nameoptionalstringThe name of the table attribute to store the TTL timestamp in
""ttl_enabledoptionalboolIndicates whether ttl is enabled
falsewarm_throughputoptionalanySets the number of warm read and write units for the specified table
{}write_capacityoptionalnumberThe number of write units for this table. If the billing_mode is PROVISIONED, this field should be greater than 0
nullAll 39 are optional — the module deploys with none of them set.
Outputs
8
dynamodb_table_arnARN of the DynamoDB table
dynamodb_table_idID of the DynamoDB table
dynamodb_table_replica_arnsMap of the Table replicas ARNs
dynamodb_table_replica_stream_arnsMap of the Table replicas stream ARNs
dynamodb_table_replica_stream_labelsMap of the timestamps of the Table replicas stream
dynamodb_table_replicasMap of Table replicas by region
dynamodb_table_stream_arnThe ARN of the Table Stream
dynamodb_table_stream_labelA 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.