{"id":19165325,"url":"https://github.com/skyscrapers/terraform-state","last_synced_at":"2025-05-07T12:23:19.269Z","repository":{"id":49930907,"uuid":"71915615","full_name":"skyscrapers/terraform-state","owner":"skyscrapers","description":"Everything for state related terraform","archived":false,"fork":false,"pushed_at":"2024-09-25T11:23:56.000Z","size":34,"stargazers_count":7,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-19T22:02:28.499Z","etag":null,"topics":["aws","s3","terraform","terraform-modules"],"latest_commit_sha":null,"homepage":null,"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/skyscrapers.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-10-25T16:14:37.000Z","updated_at":"2024-09-25T11:23:38.000Z","dependencies_parsed_at":"2025-04-19T21:44:55.308Z","dependency_job_id":"82a5528e-77fe-42fb-b0ed-ef1331a6460b","html_url":"https://github.com/skyscrapers/terraform-state","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyscrapers","download_url":"https://codeload.github.com/skyscrapers/terraform-state/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252874625,"owners_count":21817868,"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","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","s3","terraform","terraform-modules"],"created_at":"2024-11-09T09:27:27.173Z","updated_at":"2025-05-07T12:23:19.250Z","avatar_url":"https://github.com/skyscrapers.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-state\n\nEverything for state related terraform\n\n## s3\n\nCreate an S3 bucket to store the Terraform state files and a DynamoDB table to support state locking.\nThe bucket has server-side encryption enabled by default and the bucket policy enforces it for all uploads.\n\n### Available variables\n\n| Name    | Description  |  Type  | Default | Required |\n| ------- | ------------ | :----: | :-----: | :------: |\n| project | Project name | string |   n/a   |   yes    |\n\n### Output\n\n| Name             | Description                                                                   |\n| ---------------- | ----------------------------------------------------------------------------- |\n| bucket\\_id       | Id (name) of the S3 bucket                                                    |\n| locktable\\_id    | Id (name) of the DynamoDB lock table                                          |\n| tf\\_policy\\_arn  | The ARN of the policy for Terraform users to access the state and lock table  |\n| tf\\_policy\\_id   | The ID of the policy for Terraform users to access the state and lock table   |\n| tf\\_policy\\_name | The name of the policy for Terraform users to access the state and lock table |\n\n### Example\n\n```tf\nmodule \"s3\" {\n  source  = \"github.com/skyscrapers/terraform-state//s3?ref=4.0.0\"\n  project = \"some-project\"\n}\n```\n\nAfter applying the module, you can configure your Terraform backend like this:\n\n```tf\nterraform {\n  backend \"s3\" {\n    key            = \"something\" # this should be different for each Terraform configuration / stack you have\n    bucket         = \"terraform-remote-state-some-project\"\n    region         = \"eu-west-1\"\n    encrypt        = true\n    dynamodb_table = \"terraform-remote-state-lock-some-project\"\n    acl            = \"bucket-owner-full-control\"\n  }\n}\n```\n\n### Multi-account AWS Architecture\n\nWhen running Terraform on a multi-account AWS setup (e.g. an account per environment), it's recommended to setup a single S3 bucket (and DynamoDB lock table) in an \"administrative\" AWS account for the Terraform state. Please read the [Terraform S3 backend documentation](https://www.terraform.io/docs/backends/types/s3.html#multi-account-aws-architecture) for more information on this topic.\n\n## azurerm\n\nCreates an Azure resource group, a Storage account and a storage container to use as a Terraform backend.\n\n### Variables\n\n| Name     | Description                                      | Type  | Default | Required |\n| -------- | ------------------------------------------------ | ----- | ------- | :------: |\n| location | Azure region where to deploy the storage account | `any` | n/a     |   yes    |\n| project  | Project name                                     | `any` | n/a     |   yes    |\n| tags     | Additional tags to add to the created resources  | `map` | `{}`    |    no    |\n\n### Outputs\n\n| Name                   | Description                                                      |\n| ---------------------- | ---------------------------------------------------------------- |\n| resource_group_id      | Resource group ID where the storage account is deployed          |\n| resource_group_name    | Resource group name where the storage account is deployed        |\n| storage_account_id     | Storage account ID where the Terraform backend should point to   |\n| storage_account_name   | Storage account name where the Terraform backend should point to |\n| storage_container_id   | Storage container ID where to put the Terraform state files      |\n| storage_container_name | Storage container name where to put the Terraform state files    |\n\n### Examples\n\n```tf\nmodule \"tf_backend_azurerm\" {\n  source   = \"github.com/skyscrapers/terraform-state//azurerm?ref=5.0.0\"\n  project  = \"someproject\"\n  location = \"North Europe\"\n}\n```\n\nAfter applying the module, you can configure your Terraform backend like this:\n\n```tf\nterraform {\n  backend \"azurerm\" {\n    key                  = \"stacks/aks-cluster.tfstate\"\n    resource_group_name  = \"terraform-remote-state-someproject\"\n    storage_account_name = \"tfbackendsomeproject\"\n    container_name       = \"tf-state\"\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyscrapers%2Fterraform-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyscrapers%2Fterraform-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyscrapers%2Fterraform-state/lists"}