
Terragrunt Generator
Scaffold validated Terragrunt root and child HCL, multi-env folders, stacks, and dependency wiring instead of hand-writing repetitive IaC glue.
Install
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill terragrunt-generatorWhat is this skill?
- Generates root.hcl, terragrunt.hcl, terragrunt.stack.hcl, and child module layouts with validation
- Multi-environment patterns (dev/staging/prod) and dependency or dependencies block wiring
- Module sources: local paths, Git, and Terraform Registry via tfr:///
- Terragrunt 2025 features: Stacks (GA v0.78+), feature flags, exclude blocks, errors blocks
- OpenTofu engine option called out alongside modern replacement for deprecated skip and retryable_errors
Adoption & trust: 439 installs on skills.sh; 227 GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Terragrunt generation is about durable infrastructure layout and execution controls—canonical home is Operate infra, even if first authored during initial deploy setup. Outputs target root.hcl, terragrunt.hcl, stack catalogs, and module sources—the artifacts you live with in production infra repos.
Common Questions / FAQ
Is Terragrunt Generator safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Terragrunt Generator
# Terragrunt Generator ## Overview Generate production-ready Terragrunt configurations following current best practices, naming conventions, and security standards. All generated configurations are automatically validated. ## Trigger Phrases Use this skill when the user asks for: - A new `root.hcl`, `terragrunt.hcl`, or `terragrunt.stack.hcl` - Multi-environment Terragrunt layouts (`dev/staging/prod`) - Terragrunt dependency wiring (`dependency` or `dependencies` blocks) - Terragrunt module source setup (local, Git, Terraform Registry via `tfr:///`) - Stack catalog unit generation under `catalog/units/*` **Terragrunt 2025 Features Supported:** - [Stacks](https://terragrunt.gruntwork.io/docs/features/stacks/) - Infrastructure blueprints with `terragrunt.stack.hcl` (GA since v0.78.0) - [Feature Flags](https://terragrunt.gruntwork.io/docs/features/feature-flags/) - Runtime control via `feature` blocks - [Exclude Blocks](https://terragrunt.gruntwork.io/docs/reference/config-blocks-and-attributes/#exclude) - Fine-grained execution control (replaces deprecated `skip`) - [Errors Blocks](https://terragrunt.gruntwork.io/docs/reference/config-blocks-and-attributes/#errors) - Advanced error handling (replaces deprecated `retryable_errors`) - [OpenTofu Engine](https://terragrunt.gruntwork.io/docs/features/engine/) - Alternative IaC engine support ## Root Configuration Naming > **RECOMMENDED**: Use `root.hcl` instead of `terragrunt.hcl` for root files per [migration guide](https://terragrunt.gruntwork.io/docs/migrate/migrating-from-root-terragrunt-hcl). | Approach | Root File | Include Syntax | |----------|-----------|----------------| | **Modern** | `root.hcl` | `find_in_parent_folders("root.hcl")` | | **Legacy** | `terragrunt.hcl` | `find_in_parent_folders()` | **Include standard:** Default to `find_in_parent_folders("root.hcl")` in all new examples and generated configs. Use `find_in_parent_folders()` only when explicitly targeting a legacy root file named `terragrunt.hcl`. ## Architecture Patterns > **CRITICAL:** Before generating ANY configuration, you MUST determine the architecture pattern and understand its constraints. ### Pattern A: Multi-Environment with Environment-Agnostic Root **Use when:** Managing multiple environments (dev/staging/prod) with shared root configuration. **Key principle:** `root.hcl` is **environment-agnostic** - it does NOT read environment-specific files. ``` infrastructure/ ├── root.hcl # Environment-AGNOSTIC (no env.hcl references) ├── dev/ │ ├── env.hcl # Environment variables (locals block) │ ├── vpc/terragrunt.hcl │ └── rds/terragrunt.hcl └── prod/ ├── env.hcl # Environment variables (locals block) ├── vpc/terragrunt.hcl └── rds/terragrunt.hcl ``` **Root.hcl constraints:** - ❌ CANNOT use `read_terragrunt_config(find_in_parent_folders("env.hcl"))` - env.hcl doesn't exist at root level - ❌ CANNOT reference `local.environment` or `local.aws_region` that come from env.hcl - ✅ CAN use static values or `get_env()` for runtime configuration - ✅ CAN use `${path_relative_to_include()}` for state keys (this works dynamically) **Child modules read env.hcl:** ```hcl # dev/vpc/terragrunt.hcl include "root" { path = find_in_parent_folders("root.hcl") } locals { env = read_terragrunt_config(find_in_parent_folders("env.hcl")) } inputs = { name = "${local.env.locals.environment}-vpc" # Works: env.hcl exists in dev/ } ``` ### Pattern B: Single Environment or Environment-Aware Root **Use when:** Single environment OR all environments share the same root with environment detection. ``` infrastructure/ ├── root.hcl # Can be environment-aware via get_env() or directory parsing ├── account.hcl # Account-level config (optional) ├── region.hcl # Region-