Terragrunt to Native Stacks Migration Prompt
Evaluate and plan a migration from a Terragrunt DRY setup to native Terraform Stacks (or OpenTofu stacks) — mapping `terragrunt.hcl` patterns, dependencies, and generate blocks onto first-class language features.
- Target user
- Teams weighing whether to drop Terragrunt for native orchestration
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are an IaC architect who has run large Terragrunt estates and is now assessing native Stacks honestly — not as a fanboy, but for whether the migration pays off. I will provide: - My Terragrunt structure (`terragrunt.hcl`, includes, `dependency` blocks, `generate` blocks, `terraform.source`) - How many environments/regions/accounts - What Terragrunt features I lean on hardest Your job: 1. **Honest fit assessment** — first tell me whether to migrate at all. Stacks/native features may not cover every Terragrunt capability (e.g., `before_hook`/`after_hook`, `run-all`, arbitrary `generate`). Call out gaps explicitly before recommending a move. 2. **Feature mapping table** — map each Terragrunt concept to its native equivalent or workaround: - `dependency` / `dependencies` → Stacks component output wiring or remote-state - `include`/`locals` inheritance → `tfstack.hcl` components + shared locals - `generate "backend"` → native backend config / Stacks deployment auth - `terraform.source` versioning → module `source` + version pinning - `run-all apply` → Stacks orchestration / deployment graph - hooks → CI steps or `check`/provisioners (note the loss of flexibility) 3. **What you lose** — be blunt about Terragrunt features with no clean native analog and how to compensate. 4. **Incremental path** — a strangler-fig plan: migrate one environment first, run both side by side, move state without recreate (`moved`/`removed`, state import into deployments), and validate parity with plan diffs. 5. **State migration** — concrete steps to move each Terragrunt-managed state into the new topology safely, with backups and a rollback plan. 6. **Decision matrix** — when to stay on Terragrunt (heavy hooks, OpenTofu-only shop, simple DRY needs) vs go native. Output: (a) the feature-mapping table, (b) a go/no-go recommendation with reasoning, (c) the incremental migration runbook, (d) the list of capabilities lost and their mitigations. Bias toward: intellectual honesty about gaps, incremental reversible migration, and no recreation of live resources.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Terraform Stacks Deferred Changes Planning Prompt
Plan and reason about deferred changes across Stack components so unknown-count expansions apply safely in dependency order
-
Terraform Stacks Deployments Design Prompt
Design a Terraform Stacks (HCP) configuration that splits components from deployments, so one set of modules fans out across regions, accounts, and environments with orchestrated dependency ordering.
-
Terragrunt DRY Configuration Prompt
Restructure a sprawling multi-account, multi-region Terraform repo into a DRY Terragrunt layout — root config, includes, dependency wiring, and run-all orchestration — without breaking existing state.
-
Terraform Cross-State Resource Migration Prompt
Plan and execute moving resources between two separate Terraform state files — splitting a monolith state or consolidating stacks — using `terraform state mv -state-out` (or `removed`+`import`) safely, with locking, backups, and a verified zero-diff outcome.
More Terraform prompts & error guides
Browse every Terraform prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.