{"id":16900738,"url":"https://github.com/benoit74/terraform-split-state","last_synced_at":"2026-04-18T06:02:45.456Z","repository":{"id":173054142,"uuid":"650172263","full_name":"benoit74/terraform-split-state","owner":"benoit74","description":"A lean Python tool to split Terraform state file","archived":false,"fork":false,"pushed_at":"2023-06-06T14:01:48.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T13:11:12.075Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/benoit74.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}},"created_at":"2023-06-06T13:50:49.000Z","updated_at":"2023-06-06T14:01:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b6b50fb-b338-4f1b-95b2-4aec8ea258f3","html_url":"https://github.com/benoit74/terraform-split-state","commit_stats":null,"previous_names":["benoit74/terraform-split-state"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoit74%2Fterraform-split-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoit74%2Fterraform-split-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoit74%2Fterraform-split-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoit74%2Fterraform-split-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoit74","download_url":"https://codeload.github.com/benoit74/terraform-split-state/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244618519,"owners_count":20482331,"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":[],"created_at":"2024-10-13T17:55:48.664Z","updated_at":"2026-04-18T06:02:45.350Z","avatar_url":"https://github.com/benoit74.png","language":"Python","readme":"Terraform split state\n====\n\n## Purpose\n\nThis tool is meant to split a Terraform state from one file to many. See demo for sample configuration.$\n\nThis tool probably does not work if workspaces are used.\n\nThis tool assumes that you might have direct access to Terraform state file from a local environment + that you have write access to `/tmp` folder on this local environment.\n\n## Demo\n\nCreate an S3 bucket (empty preferably) to store your Terraform states and store its name in `shared_s3.tfbackend`\n\nSetup AWS credentials to access this bucket (here we use an AWS_PROFILE, but it could be anything else - or even nothing if your environment is already ready)\n```\nexport AWS_PROFILE=xxxx\n```\n\n```\ncd tool\npython -m venv venv\nsource venv/bin/activate\npip install --upgrade pip\npip install --upgrade -r requirements.txt\ncd ..\n```\n\nProvision original infrastructure + init new workspaces\n```\ncd demo/orig_project\nterraform init --backend-config=../shared_s3.tfbackend\nterraform apply --auto-approve\ncd ../1_new_project\nterraform init --backend-config=../shared_s3.tfbackend\ncd ../2_new_project\nterraform init --backend-config=../shared_s3.tfbackend\ncd ../orig_project_after\nterraform init --backend-config=../shared_s3.tfbackend\ncd ../..\n```\n\nApply demo moves (as configured in config.yaml)\n```\ncd demo\npython ../tool/main.py\ncd ..\n```\n\nCheck that everything has been moved with following actions which should all display nothing to do (\"no changes\"):\n```\ncd demo/orig_project_after\nterraform plan\ncd ../1_new_project\nterraform plan\ncd ../2_new_project\nterraform plan\ncd ../..\n```\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoit74%2Fterraform-split-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoit74%2Fterraform-split-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoit74%2Fterraform-split-state/lists"}