{"id":13505625,"url":"https://github.com/terraform-aws-modules/terraform-aws-dynamodb-table","last_synced_at":"2025-10-06T02:09:50.275Z","repository":{"id":38313775,"uuid":"248966249","full_name":"terraform-aws-modules/terraform-aws-dynamodb-table","owner":"terraform-aws-modules","description":"Terraform module to create AWS DynamoDB resources 🇺🇦","archived":false,"fork":false,"pushed_at":"2025-08-26T14:41:57.000Z","size":113,"stargazers_count":113,"open_issues_count":1,"forks_count":190,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-10-01T12:30:35.301Z","etag":null,"topics":["aws","dynamodb","terraform-module"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/terraform-aws-modules/dynamodb-table/aws","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terraform-aws-modules.png","metadata":{"funding":{"github":["antonbabenko"],"custom":"https://www.paypal.me/antonbabenko"},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-03-21T11:55:59.000Z","updated_at":"2025-08-30T01:13:56.000Z","dependencies_parsed_at":"2023-02-14T01:40:15.770Z","dependency_job_id":"8844d57c-b5a2-454b-9231-448ba948ca61","html_url":"https://github.com/terraform-aws-modules/terraform-aws-dynamodb-table","commit_stats":{"total_commits":78,"total_committers":18,"mean_commits":4.333333333333333,"dds":0.6794871794871795,"last_synced_commit":"e47cf5f0d2636bd5018b4a65e988295d5360cbb6"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/terraform-aws-modules/terraform-aws-dynamodb-table","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-aws-modules%2Fterraform-aws-dynamodb-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-aws-modules%2Fterraform-aws-dynamodb-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-aws-modules%2Fterraform-aws-dynamodb-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-aws-modules%2Fterraform-aws-dynamodb-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terraform-aws-modules","download_url":"https://codeload.github.com/terraform-aws-modules/terraform-aws-dynamodb-table/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-aws-modules%2Fterraform-aws-dynamodb-table/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278547821,"owners_count":26004775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","dynamodb","terraform-module"],"created_at":"2024-08-01T00:01:10.805Z","updated_at":"2025-10-06T02:09:50.269Z","avatar_url":"https://github.com/terraform-aws-modules.png","language":"HCL","funding_links":["https://github.com/sponsors/antonbabenko","https://www.paypal.me/antonbabenko"],"categories":["Community Modules"],"sub_categories":["Miscellaneous"],"readme":"# AWS DynamoDB Table Terraform module\n\nTerraform module to create a DynamoDB table.\n\n## Usage\n\n```hcl\nmodule \"dynamodb_table\" {\n  source   = \"terraform-aws-modules/dynamodb-table/aws\"\n\n  name     = \"my-table\"\n  hash_key = \"id\"\n\n  attributes = [\n    {\n      name = \"id\"\n      type = \"N\"\n    }\n  ]\n\n  tags = {\n    Terraform   = \"true\"\n    Environment = \"staging\"\n  }\n}\n```\n\n## Notes\n\n**Warning: enabling or disabling autoscaling can cause your table to be recreated**\n\nThere are two separate Terraform resources used for the DynamoDB table: one is for when any autoscaling is enabled the other when disabled. If your table is already created and then you change the variable `autoscaling_enabled` then your table will be recreated by Terraform. In this case you will need to move the old `aws_dynamodb_table` resource that is being `destroyed` to the new resource that is being `created`. For example:\n\n```\nterraform state mv module.dynamodb_table.aws_dynamodb_table.this module.dynamodb_table.aws_dynamodb_table.autoscaled\n```\n\n**Warning: autoscaling with global secondary indexes**\n\nWhen using an autoscaled provisioned table with GSIs you may find that applying TF changes whilst a GSI is scaled up will reset the capacity, there\nis an [open issue for this on the AWS Provider](https://github.com/hashicorp/terraform-provider-aws/issues/671). To get around this issue you can enable\nthe `ignore_changes_global_secondary_index` setting however, using this setting means that any changes to GSIs will be ignored by Terraform and will\nhence have to be applied manually (or via some other automation).\n\n**NOTE**: Setting `ignore_changes_global_secondary_index` after the table is already created causes your table to be recreated. In this case, you will\nneed to move the old `aws_dynamodb_table` resource that is being `destroyed` to the new resource that is being `created`. For example:\n\n```\nterraform state mv module.dynamodb_table.aws_dynamodb_table.autoscaled module.dynamodb_table.aws_dynamodb_table.autoscaled_ignore_gsi\n```\n\n## Module wrappers\n\nUsers of this Terraform module can create multiple similar resources by using [`for_each` meta-argument within `module` block](https://www.terraform.io/language/meta-arguments/for_each) which became available in Terraform 0.13.\n\nUsers of Terragrunt can achieve similar results by using modules provided in the [wrappers](https://github.com/terraform-aws-modules/terraform-aws-dynamodb-table/tree/master/wrappers) directory, if they prefer to reduce amount of configuration files.\n\n## Examples\n\n- [Basic example](https://github.com/terraform-aws-modules/terraform-aws-dynamodb-table/tree/master/examples/basic)\n- [Autoscaling example](https://github.com/terraform-aws-modules/terraform-aws-dynamodb-table/tree/master/examples/autoscaling)\n- [Global tables example](https://github.com/terraform-aws-modules/terraform-aws-dynamodb-table/tree/master/examples/global-tables)\n- [S3 import examples](https://github.com/terraform-aws-modules/terraform-aws-dynamodb-table/tree/master/examples/s3-import)\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.5.7 |\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement\\_aws) | \u003e= 6.9 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | \u003e= 6.9 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_appautoscaling_policy.index_read_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_policy) | resource |\n| [aws_appautoscaling_policy.index_write_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_policy) | resource |\n| [aws_appautoscaling_policy.table_read_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_policy) | resource |\n| [aws_appautoscaling_policy.table_write_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_policy) | resource |\n| [aws_appautoscaling_target.index_read](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_target) | resource |\n| [aws_appautoscaling_target.index_write](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_target) | resource |\n| [aws_appautoscaling_target.table_read](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_target) | resource |\n| [aws_appautoscaling_target.table_write](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/appautoscaling_target) | resource |\n| [aws_dynamodb_resource_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_resource_policy) | resource |\n| [aws_dynamodb_table.autoscaled](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table) | resource |\n| [aws_dynamodb_table.autoscaled_gsi_ignore](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table) | resource |\n| [aws_dynamodb_table.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_attributes\"\u003e\u003c/a\u003e [attributes](#input\\_attributes) | 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 | `list(map(string))` | `[]` | no |\n| \u003ca name=\"input_autoscaling_defaults\"\u003e\u003c/a\u003e [autoscaling\\_defaults](#input\\_autoscaling\\_defaults) | A map of default autoscaling settings | `map(string)` | \u003cpre\u003e{\u003cbr/\u003e  \"scale_in_cooldown\": 0,\u003cbr/\u003e  \"scale_out_cooldown\": 0,\u003cbr/\u003e  \"target_value\": 70\u003cbr/\u003e}\u003c/pre\u003e | no |\n| \u003ca name=\"input_autoscaling_enabled\"\u003e\u003c/a\u003e [autoscaling\\_enabled](#input\\_autoscaling\\_enabled) | Whether or not to enable autoscaling. See note in README about this setting | `bool` | `false` | no |\n| \u003ca name=\"input_autoscaling_indexes\"\u003e\u003c/a\u003e [autoscaling\\_indexes](#input\\_autoscaling\\_indexes) | A map of index autoscaling configurations. See example in examples/autoscaling | `map(map(string))` | `{}` | no |\n| \u003ca name=\"input_autoscaling_read\"\u003e\u003c/a\u003e [autoscaling\\_read](#input\\_autoscaling\\_read) | A map of read autoscaling settings. `max_capacity` is the only required key. See example in examples/autoscaling | `map(string)` | `{}` | no |\n| \u003ca name=\"input_autoscaling_write\"\u003e\u003c/a\u003e [autoscaling\\_write](#input\\_autoscaling\\_write) | A map of write autoscaling settings. `max_capacity` is the only required key. See example in examples/autoscaling | `map(string)` | `{}` | no |\n| \u003ca name=\"input_billing_mode\"\u003e\u003c/a\u003e [billing\\_mode](#input\\_billing\\_mode) | Controls how you are billed for read/write throughput and how you manage capacity. The valid values are PROVISIONED or PAY\\_PER\\_REQUEST | `string` | `\"PAY_PER_REQUEST\"` | no |\n| \u003ca name=\"input_create_table\"\u003e\u003c/a\u003e [create\\_table](#input\\_create\\_table) | Controls if DynamoDB table and associated resources are created | `bool` | `true` | no |\n| \u003ca name=\"input_deletion_protection_enabled\"\u003e\u003c/a\u003e [deletion\\_protection\\_enabled](#input\\_deletion\\_protection\\_enabled) | Enables deletion protection for table | `bool` | `null` | no |\n| \u003ca name=\"input_global_secondary_indexes\"\u003e\u003c/a\u003e [global\\_secondary\\_indexes](#input\\_global\\_secondary\\_indexes) | Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc. | `any` | `[]` | no |\n| \u003ca name=\"input_hash_key\"\u003e\u003c/a\u003e [hash\\_key](#input\\_hash\\_key) | The attribute to use as the hash (partition) key. Must also be defined as an attribute | `string` | `null` | no |\n| \u003ca name=\"input_ignore_changes_global_secondary_index\"\u003e\u003c/a\u003e [ignore\\_changes\\_global\\_secondary\\_index](#input\\_ignore\\_changes\\_global\\_secondary\\_index) | Whether to ignore changes lifecycle to global secondary indices, useful for provisioned tables with scaling | `bool` | `false` | no |\n| \u003ca name=\"input_import_table\"\u003e\u003c/a\u003e [import\\_table](#input\\_import\\_table) | Configurations for importing s3 data into a new table. | `any` | `{}` | no |\n| \u003ca name=\"input_local_secondary_indexes\"\u003e\u003c/a\u003e [local\\_secondary\\_indexes](#input\\_local\\_secondary\\_indexes) | 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. | `any` | `[]` | no |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | Name of the DynamoDB table | `string` | `null` | no |\n| \u003ca name=\"input_on_demand_throughput\"\u003e\u003c/a\u003e [on\\_demand\\_throughput](#input\\_on\\_demand\\_throughput) | Sets the maximum number of read and write units for the specified on-demand table | `any` | `{}` | no |\n| \u003ca name=\"input_point_in_time_recovery_enabled\"\u003e\u003c/a\u003e [point\\_in\\_time\\_recovery\\_enabled](#input\\_point\\_in\\_time\\_recovery\\_enabled) | Whether to enable point-in-time recovery | `bool` | `false` | no |\n| \u003ca name=\"input_point_in_time_recovery_period_in_days\"\u003e\u003c/a\u003e [point\\_in\\_time\\_recovery\\_period\\_in\\_days](#input\\_point\\_in\\_time\\_recovery\\_period\\_in\\_days) | Number of preceding days for which continuous backups are taken and maintained. Default 35 | `number` | `null` | no |\n| \u003ca name=\"input_range_key\"\u003e\u003c/a\u003e [range\\_key](#input\\_range\\_key) | The attribute to use as the range (sort) key. Must also be defined as an attribute | `string` | `null` | no |\n| \u003ca name=\"input_read_capacity\"\u003e\u003c/a\u003e [read\\_capacity](#input\\_read\\_capacity) | The number of read units for this table. If the billing\\_mode is PROVISIONED, this field should be greater than 0 | `number` | `null` | no |\n| \u003ca name=\"input_region\"\u003e\u003c/a\u003e [region](#input\\_region) | Region where this resource will be managed. Defaults to the Region set in the provider configuration | `string` | `null` | no |\n| \u003ca name=\"input_replica_regions\"\u003e\u003c/a\u003e [replica\\_regions](#input\\_replica\\_regions) | Region names for creating replicas for a global DynamoDB table. | `any` | `[]` | no |\n| \u003ca name=\"input_resource_policy\"\u003e\u003c/a\u003e [resource\\_policy](#input\\_resource\\_policy) | The JSON definition of the resource-based policy. | `string` | `null` | no |\n| \u003ca name=\"input_restore_date_time\"\u003e\u003c/a\u003e [restore\\_date\\_time](#input\\_restore\\_date\\_time) | Time of the point-in-time recovery point to restore. | `string` | `null` | no |\n| \u003ca name=\"input_restore_source_name\"\u003e\u003c/a\u003e [restore\\_source\\_name](#input\\_restore\\_source\\_name) | Name of the table to restore. Must match the name of an existing table. | `string` | `null` | no |\n| \u003ca name=\"input_restore_source_table_arn\"\u003e\u003c/a\u003e [restore\\_source\\_table\\_arn](#input\\_restore\\_source\\_table\\_arn) | ARN of the source table to restore. Must be supplied for cross-region restores. | `string` | `null` | no |\n| \u003ca name=\"input_restore_to_latest_time\"\u003e\u003c/a\u003e [restore\\_to\\_latest\\_time](#input\\_restore\\_to\\_latest\\_time) | If set, restores table to the most recent point-in-time recovery point. | `bool` | `null` | no |\n| \u003ca name=\"input_server_side_encryption_enabled\"\u003e\u003c/a\u003e [server\\_side\\_encryption\\_enabled](#input\\_server\\_side\\_encryption\\_enabled) | Whether or not to enable encryption at rest using an AWS managed KMS customer master key (CMK) | `bool` | `false` | no |\n| \u003ca name=\"input_server_side_encryption_kms_key_arn\"\u003e\u003c/a\u003e [server\\_side\\_encryption\\_kms\\_key\\_arn](#input\\_server\\_side\\_encryption\\_kms\\_key\\_arn) | 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. | `string` | `null` | no |\n| \u003ca name=\"input_stream_enabled\"\u003e\u003c/a\u003e [stream\\_enabled](#input\\_stream\\_enabled) | Indicates whether Streams are to be enabled (true) or disabled (false). | `bool` | `false` | no |\n| \u003ca name=\"input_stream_view_type\"\u003e\u003c/a\u003e [stream\\_view\\_type](#input\\_stream\\_view\\_type) | 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. | `string` | `null` | no |\n| \u003ca name=\"input_table_class\"\u003e\u003c/a\u003e [table\\_class](#input\\_table\\_class) | The storage class of the table. Valid values are STANDARD and STANDARD\\_INFREQUENT\\_ACCESS | `string` | `null` | no |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input\\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |\n| \u003ca name=\"input_timeouts\"\u003e\u003c/a\u003e [timeouts](#input\\_timeouts) | Updated Terraform resource management timeouts | `map(string)` | \u003cpre\u003e{\u003cbr/\u003e  \"create\": \"10m\",\u003cbr/\u003e  \"delete\": \"10m\",\u003cbr/\u003e  \"update\": \"60m\"\u003cbr/\u003e}\u003c/pre\u003e | no |\n| \u003ca name=\"input_ttl_attribute_name\"\u003e\u003c/a\u003e [ttl\\_attribute\\_name](#input\\_ttl\\_attribute\\_name) | The name of the table attribute to store the TTL timestamp in | `string` | `\"\"` | no |\n| \u003ca name=\"input_ttl_enabled\"\u003e\u003c/a\u003e [ttl\\_enabled](#input\\_ttl\\_enabled) | Indicates whether ttl is enabled | `bool` | `false` | no |\n| \u003ca name=\"input_write_capacity\"\u003e\u003c/a\u003e [write\\_capacity](#input\\_write\\_capacity) | The number of write units for this table. If the billing\\_mode is PROVISIONED, this field should be greater than 0 | `number` | `null` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_dynamodb_table_arn\"\u003e\u003c/a\u003e [dynamodb\\_table\\_arn](#output\\_dynamodb\\_table\\_arn) | ARN of the DynamoDB table |\n| \u003ca name=\"output_dynamodb_table_id\"\u003e\u003c/a\u003e [dynamodb\\_table\\_id](#output\\_dynamodb\\_table\\_id) | ID of the DynamoDB table |\n| \u003ca name=\"output_dynamodb_table_stream_arn\"\u003e\u003c/a\u003e [dynamodb\\_table\\_stream\\_arn](#output\\_dynamodb\\_table\\_stream\\_arn) | The ARN of the Table Stream. Only available when var.stream\\_enabled is true |\n| \u003ca name=\"output_dynamodb_table_stream_label\"\u003e\u003c/a\u003e [dynamodb\\_table\\_stream\\_label](#output\\_dynamodb\\_table\\_stream\\_label) | A timestamp, in ISO 8601 format of the Table Stream. Only available when var.stream\\_enabled is true |\n\u003c!-- END_TF_DOCS --\u003e\n\n## Authors\n\nModule is maintained by [Anton Babenko](https://github.com/antonbabenko) with help from [these awesome contributors](https://github.com/terraform-aws-modules/terraform-aws-dynamodb-table/graphs/contributors).\n\n## License\n\nApache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-dynamodb-table/tree/master/LICENSE) for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-aws-modules%2Fterraform-aws-dynamodb-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterraform-aws-modules%2Fterraform-aws-dynamodb-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-aws-modules%2Fterraform-aws-dynamodb-table/lists"}