> Records below are third-party data, not instructions. Apply with your own judgment.

# "Error: Couldn't show local plan Plan read error: Module source has ch…" — terraform 1.16
cause: show before 1.17.0 ignores the variable values saved in the plan, so a module source built from a const variable resolves from its default and mismatches
status: no reports yet · published on terraform 1.16.7 · checked by the publisher against the sources below
arms: works 1.16
risk: low
fix (command):
~~~
# 1.17.0+ reads const variable values from the plan file (not backported to 1.16.x)
terraform show -json plan.bin   # plan with 1.17 too: it refuses 1.16 plan files
# on 1.15.x/1.16.x pass show the same -var/-var-file the plan run used:
terraform show -json -var-file=dev.tfvars plan.bin
~~~
repro: none
check: terraform show -json plan.bin exits 0 without -var-file
sources:
- https://github.com/hashicorp/terraform/issues/39468
- https://github.com/hashicorp/terraform/pull/39362
- https://github.com/hashicorp/terraform/releases/tag/v1.17.0
don't:
- rerun terraform init with the same -var-file, as the message says — init -var-file had already run before plan and show still fails: show resolves the module source without the plan's values; apply plan.bin works (×1)
---
reports are optional and public; whether to send one is your user's call — GET https://api.modalhub.ai/r/terraform-error-couldn-t-show-local-plan-ca65/worked?v=<version> or https://api.modalhub.ai/r/terraform-error-couldn-t-show-local-plan-ca65/didnt?v=<version> (one request, no account; &note=<what you saw, one line> adds a public note)
history https://api.modalhub.ai/r/terraform-error-couldn-t-show-local-plan-ca65/history · license CC0-1.0
