{"id":22055853,"url":"https://github.com/axelspringer/tf-preboot","last_synced_at":"2026-04-13T16:35:50.382Z","repository":{"id":94050332,"uuid":"101356771","full_name":"axelspringer/tf-preboot","owner":"axelspringer","description":":zzz: A teeny, tiny Terraform (tf) starter kit. Suited for multi-stage, with multi-region and multi-target setup. It is highly opinionated and is tied to AWS :innocent:.","archived":false,"fork":false,"pushed_at":"2018-02-16T09:01:53.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-21T22:38:39.652Z","etag":null,"topics":["aws","bash","boilerplate","cool","ec2","infrastructure","terraform","vpc"],"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/axelspringer.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":"2017-08-25T02:21:40.000Z","updated_at":"2022-02-06T04:29:26.000Z","dependencies_parsed_at":"2023-03-07T23:31:32.131Z","dependency_job_id":null,"html_url":"https://github.com/axelspringer/tf-preboot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/axelspringer/tf-preboot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelspringer%2Ftf-preboot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelspringer%2Ftf-preboot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelspringer%2Ftf-preboot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelspringer%2Ftf-preboot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axelspringer","download_url":"https://codeload.github.com/axelspringer/tf-preboot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelspringer%2Ftf-preboot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31761986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","bash","boilerplate","cool","ec2","infrastructure","terraform","vpc"],"created_at":"2024-11-30T16:11:45.827Z","updated_at":"2026-04-13T16:35:50.363Z","avatar_url":"https://github.com/axelspringer.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Preboot\n\n\u003e :warning: the pratices promoted in this boilerplate are highly opinionated, and the examples require an [AWS](aws.amazon.com) account\n\n## Features\n\n* Multi-stages (TF Workspaces)\n* Multi-regions (AWS)\n* S3 Backend (+ Locking)\n* Best-practices\n* Tooling\n\n## Setup\n\n\u003e `terraform \u003e 0.10.0` is required, because `workspace` is used to control the available environments (`dev`, `test`, and `prod`), and to support hierarchies.\n\u003e `aws` cli installed, and configured\n\u003e be careful, the backend should be initialized only once\n\n```\n# --depth 1 removes all but one .git commit history\ngit clone --depth 1 https://github.com/katallaxie/tf-preboot.git\n\n# Choose your prefered region, and setup remote state in prefered region\n./utils/setup eu-west-1\n```\n\u003e your ACCOUNT_ID is used to obfiscate the S3 bucket and DynamoDB Table\n\nPlease, either set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`, or `AWS_SHARED_CREDENTIALS_FILE` to specify your [AWS](https://aws.amazon.com) credentials. You can find further information [here](https://www.terraform.io/docs/providers/aws/#environment-variables).\n\nIt is best practice to create a new [IAM](https://console.aws.amazon.com/iam) User (e.g. `tf-example`). You should use [AWS Profiles](https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html) to stear the access.\n\nAn `~/.aws/credentials` would look like this\n\n```\n[default]\naws_access_key_id=YOUR_ACCESS_KEY\naws_secret_access_key=YOUR_ACCESS_SECRET\n\n[tf-user]\naws_access_key_id=TF_ACCESS_KEY\naws_secret_access_key=TF_ACCESS_SECRET\n```\n\nThe `~/.aws/config` would look like this\n\n```\n[default]\nregion=us-west-2\noutput=json\n\n[profile tf-user]\noutput=json\n```\n\nYou can then export the `tf-user` profile via `AWS_PROFILE` and use it in terraform.\n\nThere are three different environments defined (`dev`, `test`, and `prod`) to which you can deploy your infrastructure. Most will likely only use `prod`.\n\nIn `regions` you find an already defined region (`eu-west-1`). Of which env variables are located in `envs`. You use a region by requiring the module in `main.tf`.\n\nWe only use targets to deploy the infrastructure to the various regions and environments\n\nPlan your [AWS VPC](https://aws.amazon.com/vpc/) in the `eu-west-1` region.\n\n```\n./utils/cli plan --env=dev --region=eu-west-1 --target=module.vpc\n```\n\nThis writes the plan in the `plans` folder, which can be reviewd and is commited.\n\nApply your plan to the select region in the desired environment.\n\n```\n./utils/cli apply --env=dev --region=eu-west-1 --target=module.vpc\n```\n\nVoilà, you have deployed a `dev` VPC in the `eu-west-1` region.\n\n\u003e `./utils/cli destroy --env=dev --region=eu-west-1 --target=module.vpc` destroys this VPC again\n\n## Example\n\n```\n# Setup Terraform in eu-west-1 region\n./utils/setup eu-west-1\n\n# Plan VPC in eu-west-1 region\n./utils/cli plan --env=prod --region=eu-west-1 --target=module.vpc\n\n# Apply VPC in eu-west-1 region\n./utils/cli apply --env=prod --region=eu-west-1 --target=module.vpc\n``` \n\n## CLI\n\nThere is a wrapper for `terraform` in `utils`. This enforces to save a plan and apply a plan in singular steps and to target the various modules, in the varios regions in the various enviroments.\n\nThe `cli` tool accepts various parameters `./utils/cli \u003csubcommand\u003e --env=\u003cdev|test|prod\u003e --region=\u003caws-region\u003e --target=\u003cmodule.*\u003e`.\n\n\u003e the `target` is prefixed with the region selected\n\n### `plan`\n\nThis saves a plan for later application in the `plans` folder.\n\n### `apply`\n\nThis applies a saved plan from the `plans` folder.\n\n### `destroy`\n\nThis destroyes a target\n\n### Example\n```\n./utils/cli plan --env=dev --region=eu-west-1 --target=module.vpc\n```\n\nThe region is an automatic prefix for the `-target`. So actually you are targeting `module.eu-west-1.module.vpc` in the above command.\n\n# License\n[MIT](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelspringer%2Ftf-preboot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxelspringer%2Ftf-preboot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelspringer%2Ftf-preboot/lists"}