{"id":19188753,"url":"https://github.com/miquido/terraform-tfstate-backend","last_synced_at":"2026-03-01T05:36:26.547Z","repository":{"id":197243624,"uuid":"690900860","full_name":"miquido/terraform-tfstate-backend","owner":"miquido","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-13T06:30:00.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dependabot-terraform-hashicorp-aws-tw-5.16","last_synced_at":"2025-02-23T03:42:19.497Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miquido.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-09-13T05:40:48.000Z","updated_at":"2023-09-13T06:24:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9b254b6-3990-43c9-96fb-7ab42f2dd8e0","html_url":"https://github.com/miquido/terraform-tfstate-backend","commit_stats":null,"previous_names":["miquido/terraform-tfstate-backend"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/miquido/terraform-tfstate-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquido%2Fterraform-tfstate-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquido%2Fterraform-tfstate-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquido%2Fterraform-tfstate-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquido%2Fterraform-tfstate-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miquido","download_url":"https://codeload.github.com/miquido/terraform-tfstate-backend/tar.gz/refs/heads/dependabot-terraform-hashicorp-aws-tw-5.16","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miquido%2Fterraform-tfstate-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29960478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"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":[],"created_at":"2024-11-09T11:25:55.641Z","updated_at":"2026-03-01T05:36:26.503Z","avatar_url":"https://github.com/miquido.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- This file was automatically generated by the `build-harness`. Make all changes to `README.yaml` and run `make readme` to rebuild this file. --\u003e\n[![Miquido][logo]](https://www.miquido.com/)\n\n# terraform-tfstate-backend\nTerraform module to provision S3 Bucket for Terraform State Backend and DynamoDB Table for state locking.\n\n### Open source modules used:\n* https://github.com/cloudposse/terraform-aws-tfstate-backend\n---\n**Terraform Module**\n\n\nGitLab Repository: https://gitlab.com/miquido/terraform/terraform-tfstate-backend\n\n## Usage\n\n1. Use module to create bucket\n\n    ```\n    terraform {}\n\n    module \"tfstate-backend\" {\n        source      = \"git::ssh://git@gitlab.com:miquido/terraform/terraform-tfstate-backend.git?ref=master\"\n        name        = \"miquido\"\n        environment = \"devops\"\n    }\n\n    output \"config\" {\n        value = \"${module.tfstate-backend.tf_backend_config}\"\n    }\n    ```\n\n2. Run commands\n\n    ```bash\n    terraform init\n    terraform apply\n\n    # in output there should be rendered tf backend config\n    ```\n\n3. Add terraform backend\n\n    ```\n    terraform {\n        backend \"s3\" {\n            region         = \"eu-west-2\"\n            bucket         = \"miquido-devops-terraform-state\"\n            key            = \"terraform.tfstate\"\n            dynamodb_table = \"miquido-devops-terraform-state-lock\"\n            encrypt        = true\n        }\n    }\n\n    module \"tfstate-backend\" {\n        ...\n    }\n    ```\n4. Run commands again\n\n    ```bash\n    terraform init\n    terraform apply\n    ```\n\n5. When asked to copy local tfstate to s3 bucket, answer yes.\n\u003c!-- markdownlint-disable --\u003e\n## Makefile Targets\n```text\nAvailable targets:\n\n  help                                Help screen\n  help/all                            Display help for all targets\n  help/short                          This help short screen\n  lint                                Lint Terraform code\n\n```\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- markdownlint-disable --\u003e\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.16 |\n| \u003ca name=\"requirement_local\"\u003e\u003c/a\u003e [local](#requirement\\_local) | \u003e= 1.3 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | ~\u003e 5.16 |\n| \u003ca name=\"provider_local\"\u003e\u003c/a\u003e [local](#provider\\_local) | \u003e= 1.3 |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_this\"\u003e\u003c/a\u003e [this](#module\\_this) | cloudposse/tfstate-backend/aws | 1.1.1 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [local_file.terraform_backend_config](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource |\n| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |\n| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_billing_mode\"\u003e\u003c/a\u003e [billing\\_mode](#input\\_billing\\_mode) | DynamoDB billing mode | `string` | `\"PAY_PER_REQUEST\"` | no |\n| \u003ca name=\"input_environment\"\u003e\u003c/a\u003e [environment](#input\\_environment) | Environment name | `string` | `\"\"` | no |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | Account/Project Name | `string` | n/a | yes |\n| \u003ca name=\"input_read_capacity\"\u003e\u003c/a\u003e [read\\_capacity](#input\\_read\\_capacity) | DynamoDB read capacity units | `number` | `1` | no |\n| \u003ca name=\"input_role_account_id\"\u003e\u003c/a\u003e [role\\_account\\_id](#input\\_role\\_account\\_id) | The AWS Account ID of IAM Role to be assumed. If none provided current caller account id will be used. | `string` | `\"\"` | no |\n| \u003ca name=\"input_role_name\"\u003e\u003c/a\u003e [role\\_name](#input\\_role\\_name) | The IAM Role name to be assumed | `string` | `\"AdministratorAccess\"` | no |\n| \u003ca name=\"input_s3_bucket_name\"\u003e\u003c/a\u003e [s3\\_bucket\\_name](#input\\_s3\\_bucket\\_name) | S3 bucket name. If not provided, the name will be generated by the label module in the format namespace-stage-name | `string` | `\"\"` | no |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input\\_tags) | Tags to apply on repository | `map(string)` | `{}` | no |\n| \u003ca name=\"input_terraform_backend_config_file_name\"\u003e\u003c/a\u003e [terraform\\_backend\\_config\\_file\\_name](#input\\_terraform\\_backend\\_config\\_file\\_name) | Name of terraform backend config file | `string` | `\"tfstate-backend.tf\"` | no |\n| \u003ca name=\"input_terraform_backend_config_file_path\"\u003e\u003c/a\u003e [terraform\\_backend\\_config\\_file\\_path](#input\\_terraform\\_backend\\_config\\_file\\_path) | The path to terrafrom project directory. Won't create local file if variable value is empty. Recommended: `path.module` | `string` | `\"\"` | no |\n| \u003ca name=\"input_terraform_minimum_version\"\u003e\u003c/a\u003e [terraform\\_minimum\\_version](#input\\_terraform\\_minimum\\_version) | Minimum version for terraform | `string` | `\"0.13.5\"` | no |\n| \u003ca name=\"input_write_capacity\"\u003e\u003c/a\u003e [write\\_capacity](#input\\_write\\_capacity) | DynamoDB write capacity units | `number` | `1` | 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) | The ARN of created DynamoDB Table |\n| \u003ca name=\"output_dynamodb_table_id\"\u003e\u003c/a\u003e [dynamodb\\_table\\_id](#output\\_dynamodb\\_table\\_id) | The ID of created DynamoDB Table |\n| \u003ca name=\"output_dynamodb_table_name\"\u003e\u003c/a\u003e [dynamodb\\_table\\_name](#output\\_dynamodb\\_table\\_name) | The name of created DynamoDB Table |\n| \u003ca name=\"output_s3_bucket_arn\"\u003e\u003c/a\u003e [s3\\_bucket\\_arn](#output\\_s3\\_bucket\\_arn) | S3 bucket ARN |\n| \u003ca name=\"output_s3_bucket_domain_name\"\u003e\u003c/a\u003e [s3\\_bucket\\_domain\\_name](#output\\_s3\\_bucket\\_domain\\_name) | S3 bucket domain name |\n| \u003ca name=\"output_s3_bucket_id\"\u003e\u003c/a\u003e [s3\\_bucket\\_id](#output\\_s3\\_bucket\\_id) | S3 bucket ID |\n| \u003ca name=\"output_tf_backend_config\"\u003e\u003c/a\u003e [tf\\_backend\\_config](#output\\_tf\\_backend\\_config) | Rendered Terraform backend config file |\n\u003c!-- markdownlint-restore --\u003e\n\n\n## Developing\n\n1. Make changes in terraform files\n\n2. Regenerate documentation\n\n    ```bash\n    bash \u003c(git archive --remote=git@gitlab.com:miquido/terraform/terraform-readme-update.git master update.sh | tar -xO)\n    ```\n\n3. Run lint\n\n    ```\n    make lint\n    ```\n\n## Copyright\n\nCopyright © 2017-2023 [Miquido](https://miquido.com)\n\n\n\n### Contributors\n\n|  [![Konrad Obal][k911_avatar]][k911_homepage]\u003cbr/\u003e[Konrad Obal][k911_homepage] |\n|---|\n\n  [k911_homepage]: https://github.com/k911\n  [k911_avatar]: https://github.com/k911.png?size=150\n\n\n\n  [logo]: https://www.miquido.com/img/logos/logo__miquido.svg\n  [website]: https://www.miquido.com/\n  [gitlab]: https://gitlab.com/miquido\n  [github]: https://github.com/miquido\n  [bitbucket]: https://bitbucket.org/miquido\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiquido%2Fterraform-tfstate-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiquido%2Fterraform-tfstate-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiquido%2Fterraform-tfstate-backend/lists"}