{"id":20721351,"url":"https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate","last_synced_at":"2025-09-04T07:44:07.431Z","repository":{"id":192429680,"uuid":"686697380","full_name":"bendoerr-terraform-modules/terraform-aws-tfstate","owner":"bendoerr-terraform-modules","description":"Ben's Terraform AWS TFState Remote Backend Module","archived":false,"fork":false,"pushed_at":"2025-08-11T14:52:23.000Z","size":214,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-11T16:30:16.746Z","etag":null,"topics":["terraform","terraform-module","terraform-module-aws","terraform-state-backend"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bendoerr-terraform-modules.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-03T16:49:16.000Z","updated_at":"2024-09-09T12:48:30.000Z","dependencies_parsed_at":"2023-11-13T20:24:25.188Z","dependency_job_id":"0aa8aafe-18d2-4e01-b81c-57f4d1337f03","html_url":"https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate","commit_stats":null,"previous_names":["bendoerr-terraform-modules/terraform-aws-tfstate"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bendoerr-terraform-modules/terraform-aws-tfstate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendoerr-terraform-modules%2Fterraform-aws-tfstate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendoerr-terraform-modules%2Fterraform-aws-tfstate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendoerr-terraform-modules%2Fterraform-aws-tfstate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendoerr-terraform-modules%2Fterraform-aws-tfstate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendoerr-terraform-modules","download_url":"https://codeload.github.com/bendoerr-terraform-modules/terraform-aws-tfstate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendoerr-terraform-modules%2Fterraform-aws-tfstate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273574126,"owners_count":25129882,"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-09-04T02:00:08.968Z","response_time":61,"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":["terraform","terraform-module","terraform-module-aws","terraform-state-backend"],"created_at":"2024-11-17T03:27:09.249Z","updated_at":"2025-09-04T07:44:07.390Z","avatar_url":"https://github.com/bendoerr-terraform-modules.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/raw/main/docs/logo-dark.png\"\u003e\n      \u003cimg src=\"https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/raw/main/docs/logo-light.png\" alt=\"Logo\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n\n\u003ch3 align=\"center\"\u003eBen's Terraform AWS Terraform Remote State Module\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    This is how I do it.\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/issues\"\u003eReport Bug\u003c/a\u003e\n    .\n    \u003ca href=\"https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n[\u003cimg alt=\"GitHub contributors\" src=\"https://img.shields.io/github/contributors/bendoerr-terraform-modules/terraform-aws-tfstate?logo=github\"\u003e](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/graphs/contributors)\n[\u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/bendoerr-terraform-modules/terraform-aws-tfstate?logo=github\"\u003e](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/issues)\n[\u003cimg alt=\"GitHub pull requests\" src=\"https://img.shields.io/github/issues-pr/bendoerr-terraform-modules/terraform-aws-tfstate?logo=github\"\u003e](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/pulls)\n[\u003cimg alt=\"GitHub workflow: Terratest\" src=\"https://img.shields.io/github/actions/workflow/status/bendoerr-terraform-modules/terraform-aws-tfstate/test.yml?logo=githubactions\u0026label=terratest\"\u003e](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/actions/workflows/test.yml)\n[\u003cimg alt=\"GitHub workflow: Linting\" src=\"https://img.shields.io/github/actions/workflow/status/bendoerr-terraform-modules/terraform-aws-tfstate/lint.yml?logo=githubactions\u0026label=linting\"\u003e](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/actions/workflows/lint.yml)\n[\u003cimg alt=\"GitHub tag (with filter)\" src=\"https://img.shields.io/github/v/tag/bendoerr-terraform-modules/terraform-aws-tfstate?filter=v*\u0026label=latest%20tag\u0026logo=terraform\"\u003e](https://registry.terraform.io/modules/bendoerr-terraform-modules/label/null/latest)\n[\u003cimg alt=\"OSSF-Scorecard Score\" src=\"https://img.shields.io/ossf-scorecard/github.com/bendoerr-terraform-modules/terraform-aws-tfstate?logo=securityscorecard\u0026label=ossf%20scorecard\u0026link=https%3A%2F%2Fsecurityscorecards.dev%2Fviewer%2F%3Furi%3Dgithub.com%2Fbendoerr-terraform-modules%2Fterraform-aws-tfstate\"\u003e](https://securityscorecards.dev/viewer/?uri=github.com/bendoerr-terraform-modules/terraform-aws-tfstate)\n[\u003cimg alt=\"GitHub License\" src=\"https://img.shields.io/github/license/bendoerr-terraform-modules/terraform-aws-tfstate?logo=opensourceinitiative\"\u003e](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/blob/main/LICENSE.txt)\n\n## About The Project\n\nBen's Terraform AWS TFState Remote Backend Module\n\n## Usage\n\nStart with a simple Terraform project looking something similar to the\nfollowing. This module will create the S3 bucket and DynamoDB table you need. A\ngood practice is to keep this Terraform project simple and check the state data\ninto your source control.\n\n```terraform\nmodule \"context\" {\n  source    = \"bendoerr-terraform-modules/context/null\"\n  version   = \"xxx\"\n  namespace = \"bd\"\n  role      = \"production\"\n  region    = \"us-east-1\"\n  project   = \"tfstate\"\n}\n\nmodule \"tfstate\" {\n  source  = \"bendoerr-terraform-modules/tfstate/aws\"\n  version = \"xxx\"\n  context = module.context.shared\n}\n\noutput \"store\" {\n  value = module.tfstate.tfstate_id # -\u003e bd-prod-ue1-tfstate-store\n}\n\noutput \"lock_table\" {\n  value = module.tfstate.lock_table_name # -\u003e bd-prod-ue1-tfstate-locks\n}\n```\n\nIn future projects your TF state can be centrally maintained.\n\n```terraform\nterraform {\n  backend \"s3\" {\n    bucket               = \"brd-prod-ue1-tfstate-store\"\n    dynamodb_table       = \"brd-prod-ue1-tfstate-locks\"\n    key                  = \"terraform.tfstate\"\n    kms_key_id           = \"alias/aws/s3\"\n    region               = \"us-east-1\"\n    workspace_key_prefix = \"foundryvtt-on-demand\"\n  }\n}\n```\n\n### Cost\n\n\u003ca href=\"https://dashboard.infracost.io/org/bendoerr/repos/8e371a47-5161-427f-a0b9-e8fb9d7bf2a5?tab=settings\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https://dashboard.api.infracost.io/shields/json/6e706676-64ba-43db-97b9-bd92f9272474/repos/8e371a47-5161-427f-a0b9-e8fb9d7bf2a5/branch/feee4136-0bbb-4a2e-9874-21543ff6b443\" alt=\"infracost\"/\u003e\u003c/a\u003e\n\n```text\nProject: 10 Workspaces \u0026 5 Applies Each Per Day\nModule path: examples/complete\n\n Name                                               Monthly Qty  Unit         Monthly Cost\n\n module.tfstate.aws_dynamodb_table.locks\n ├─ Write request unit (WRU)                              1,500  WRUs                $0.00\n └─ Read request unit (RRU)                               1,500  RRUs                $0.00\n\n module.tfstate.module.store.aws_s3_bucket.this[0]\n └─ Standard\n    ├─ Storage                                             0.02  GB                  $0.00\n    ├─ PUT, COPY, POST, LIST requests                       4.5  1k requests         $0.02\n    └─ GET, SELECT, and all other requests                    3  1k requests         $0.00\n\n OVERALL TOTAL                                                                       $0.03\n──────────────────────────────────\n9 cloud resources were detected:\n∙ 2 were estimated, all of which include usage-based costs, see https://infracost.io/usage-file\n∙ 7 were free, rerun with --show-skipped to see details\n\n┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓\n┃ Project                                            ┃ Monthly cost ┃\n┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━┫\n┃ 10 Workspaces \u0026 5 Applies Each Per Day             ┃ $0.03        ┃\n┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┛\n```\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n\n### Requirements\n\n| Name                                                                     | Version |\n| ------------------------------------------------------------------------ | ------- |\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement_terraform) | \u003e= 0.13 |\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement_aws)                   | ~\u003e 5.0  |\n\n### Providers\n\n| Name                                             | Version |\n| ------------------------------------------------ | ------- |\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider_aws) | ~\u003e 5.0  |\n\n### Modules\n\n| Name                                                                                   | Source                                | Version |\n| -------------------------------------------------------------------------------------- | ------------------------------------- | ------- |\n| \u003ca name=\"module_label_dynamodb_rw\"\u003e\u003c/a\u003e [label_dynamodb_rw](#module_label_dynamodb_rw) | bendoerr-terraform-modules/label/null | 0.4.1   |\n| \u003ca name=\"module_label_locks\"\u003e\u003c/a\u003e [label_locks](#module_label_locks)                   | bendoerr-terraform-modules/label/null | 0.4.1   |\n| \u003ca name=\"module_label_s3_rw\"\u003e\u003c/a\u003e [label_s3_rw](#module_label_s3_rw)                   | bendoerr-terraform-modules/label/null | 0.4.1   |\n| \u003ca name=\"module_label_store\"\u003e\u003c/a\u003e [label_store](#module_label_store)                   | bendoerr-terraform-modules/label/null | 0.4.1   |\n| \u003ca name=\"module_store\"\u003e\u003c/a\u003e [store](#module_store)                                     | terraform-aws-modules/s3-bucket/aws   | 3.15.1  |\n\n### Resources\n\n| Name                                                                                                                                      | Type        |\n| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------- |\n| [aws_dynamodb_table.locks](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table)                    | resource    |\n| [aws_iam_policy.s3_rw](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy)                            | resource    |\n| [aws_iam_policy.state_dynamodb_rw](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy)                | resource    |\n| [aws_iam_policy_document.dynamodb_rw](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_iam_policy_document.s3_rw](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)       | data source |\n| [aws_kms_alias.s3](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/kms_alias)                              | data source |\n\n### Inputs\n\n| Name                                                   | Description                                      | Type                                                                                                                                                                                                                                                                                                                      | Default | Required |\n| ------------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | :------: |\n| \u003ca name=\"input_context\"\u003e\u003c/a\u003e [context](#input_context) | Shared Context from Ben's terraform-null-context | \u003cpre\u003eobject({\u003cbr\u003e attributes = list(string)\u003cbr\u003e dns_namespace = string\u003cbr\u003e environment = string\u003cbr\u003e instance = string\u003cbr\u003e instance_short = string\u003cbr\u003e namespace = string\u003cbr\u003e region = string\u003cbr\u003e region_short = string\u003cbr\u003e role = string\u003cbr\u003e role_short = string\u003cbr\u003e project = string\u003cbr\u003e tags = map(string)\u003cbr\u003e })\u003c/pre\u003e | n/a     |   yes    |\n\n### Outputs\n\n| Name                                                                                      | Description |\n| ----------------------------------------------------------------------------------------- | ----------- |\n| \u003ca name=\"output_iam_locks_rw_arn\"\u003e\u003c/a\u003e [iam_locks_rw_arn](#output_iam_locks_rw_arn)       | n/a         |\n| \u003ca name=\"output_iam_locks_rw_id\"\u003e\u003c/a\u003e [iam_locks_rw_id](#output_iam_locks_rw_id)          | n/a         |\n| \u003ca name=\"output_iam_tfstate_rw_arn\"\u003e\u003c/a\u003e [iam_tfstate_rw_arn](#output_iam_tfstate_rw_arn) | n/a         |\n| \u003ca name=\"output_iam_tfstate_rw_id\"\u003e\u003c/a\u003e [iam_tfstate_rw_id](#output_iam_tfstate_rw_id)    | n/a         |\n| \u003ca name=\"output_lock_table_arn\"\u003e\u003c/a\u003e [lock_table_arn](#output_lock_table_arn)             | n/a         |\n| \u003ca name=\"output_lock_table_id\"\u003e\u003c/a\u003e [lock_table_id](#output_lock_table_id)                | n/a         |\n| \u003ca name=\"output_lock_table_name\"\u003e\u003c/a\u003e [lock_table_name](#output_lock_table_name)          | n/a         |\n| \u003ca name=\"output_tfstate_arn\"\u003e\u003c/a\u003e [tfstate_arn](#output_tfstate_arn)                      | n/a         |\n| \u003ca name=\"output_tfstate_id\"\u003e\u003c/a\u003e [tfstate_id](#output_tfstate_id)                         | n/a         |\n\n\u003c!-- END_TF_DOCS --\u003e\n\n## Roadmap\n\n[\u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/bendoerr-terraform-modules/terraform-aws-tfstate?logo=github\"\u003e](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/issues)\n\nSee the\n[open issues](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/issues)\nfor a list of proposed features (and known issues).\n\n## Contributing\n\n[\u003cimg alt=\"GitHub pull requests\" src=\"https://img.shields.io/github/issues-pr/bendoerr-terraform-modules/terraform-aws-tfstate?logo=github\"\u003e](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/pulls)\n\nContributions are what make the open source community such an amazing place to\nbe learn, inspire, and create. Any contributions you make are **greatly\nappreciated**.\n\n- If you have suggestions for adding or removing projects, feel free to\n  [open an issue](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/issues/new)\n  to discuss it, or directly create a pull request after you edit the\n  _README.md_ file with necessary changes.\n- Please make sure you check your spelling and grammar.\n- Create individual PR for each suggestion.\n\n### Creating A Pull Request\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\n[\u003cimg alt=\"GitHub License\" src=\"https://img.shields.io/github/license/bendoerr-terraform-modules/terraform-aws-tfstate?logo=opensourceinitiative\"\u003e](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/blob/main/LICENSE.txt)\n\nDistributed under the MIT License. See\n[LICENSE](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/blob/main/LICENSE.txt)\nfor more information.\n\n## Authors\n\n[\u003cimg alt=\"GitHub contributors\" src=\"https://img.shields.io/github/contributors/bendoerr-terraform-modules/terraform-aws-tfstate?logo=github\"\u003e](https://github.com/bendoerr-terraform-modules/terraform-aws-tfstate/graphs/contributors)\n\n- **Benjamin R. Doerr** - _Terraformer_ -\n  [Benjamin R. Doerr](https://github.com/bendoerr/) - _Built Ben's Terraform\n  Modules_\n\n## Supported Versions\n\nOnly the latest tagged version is supported.\n\n## Reporting a Vulnerability\n\nSee [SECURITY.md](SECURITY.md).\n\n## Acknowledgements\n\n- [ShaanCoding (ReadME Generator)](https://github.com/ShaanCoding/ReadME-Generator)\n- [OpenSSF - Helping me follow best practices](https://openssf.org/)\n- [StepSecurity - Helping me follow best practices](https://app.stepsecurity.io/)\n- [Infracost - Better than AWS Calculator](https://www.infracost.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendoerr-terraform-modules%2Fterraform-aws-tfstate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendoerr-terraform-modules%2Fterraform-aws-tfstate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendoerr-terraform-modules%2Fterraform-aws-tfstate/lists"}