A Cookiecutter template to scaffold scalable, multi-environment Terragrunt infrastructure projects.
Project description
cookiecutter-terragrunt-project
A Cookiecutter template to scaffold
scalable, multi-environment Terragrunt
infrastructure projects: a DRY root configuration (providers, GCS remote
state, version pin), a per-environment config.<env>.yaml, and a set of
shell helpers wrapping the Terragrunt CLI.
Features
- Multi-environment — switch between
dev/staging/prodwith a per-environment YAML config. - DRY — one root
terragrunt.hclevery module inherits viafind_in_parent_folders(). - Batteries included —
.bashrchelpers (switch_env,plan,apply,destroy, …) wrapping the modern Terragrunt CLI. - Pairs with terragrunt-generator
to populate the scaffold with per-module
terragrunt.hclfiles.
Requirements
- Python 3.12+
- Terraform / OpenTofu and Terragrunt (>= v0.73, new CLI)
Usage
Generate a project straight from GitHub (no install needed):
uvx cookiecutter gh:goabonga/cookiecutter-terragrunt-project
# or: cookiecutter gh:goabonga/cookiecutter-terragrunt-project
Or install the published template from PyPI and bake the bundled copy:
pip install cookiecutter-terragrunt-project
cookiecutter "$(python -c 'import cookiecutter_terragrunt_project as p; print(p.__path__[0])')"
Answer the prompts (project_name, default_environment,
remote_state_bucket_name, …) and you get:
<project_slug>/
├── .bashrc # terragrunt helpers (switch_env, plan, apply, …)
├── config.<env>.yaml # per-environment values
└── google/
└── terragrunt.hcl # root config: providers, GCS backend, versions
Day-2 workflow
source .bashrc # adds switch_env / plan / apply / destroy / …
switch_env dev # sets ENV=dev and the gcloud project
plan ./google/network # terragrunt run --all -- plan on a subtree
apply ./google/network/vpc
Development
git clone https://github.com/goabonga/cookiecutter-terragrunt-project.git
cd cookiecutter-terragrunt-project
uv sync
uv run pytest # bake smoke tests
uvx cookiecutter . # generate a project from the working copy
See CONTRIBUTING.md for the workflow, the commit-message convention and the release process. By participating you agree to the Code of Conduct. Security issues: see SECURITY.md.
License
Distributed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters