Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
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.

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

More Terraform prompts & error guides

Browse every Terraform prompt and troubleshooting guide in one place.

Free download · 368-page PDF

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.