Interview Prep/Terraform/Modules, Variables, Sensitive Values and Workspaces

Terragrunt: `Error: Backend configuration changed` appears in every module after upgrading Terragrunt.

AdvancedTroubleshootingModules, Variables, Sensitive Values and Workspaces
Answer

Likely causes → The generated backend.tf content changed (new defaults, different key format or added settings), so cached .terraform doesn't match. Or .terragrunt-cache is stale.

Diagnose → Compare generated backend files between versions; check remote_state block and path_relative_to_include() output.

Fix → Clear caches (find . -type d -name .terragrunt-cache -prune -exec rm -rf {} +) and run terragrunt init -reconfigure. If the key changed, migrate state (-migrate-state) or fix the key back.

Prevent → Pin the Terragrunt version (terragrunt_version_constraint) and test upgrades on one stack first.

All Terraform questions Roadmap: Terraform

More on Modules, Variables, Sensitive Values and Workspaces