Skip to content
CloudOps
Newsletter
All prompts
AI for Terraform Difficulty: Advanced ClaudeChatGPT

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.
Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 1,603 DevOps AI prompts
  • One practical workflow email per week