Generating a JSON version of a saved plan file may fail on Terraform v1.0.1. This issue has been specifically observed in environments which are running a Terraform cloud agent.
- Terraform v1.0.1
- terraform show JSON
- terraform plan -out=plan.out
- terraform show -json plan.out
In Terraform v1.0.1, we mark the resource instance value with any marks stored in
AttrSensitivePathsto build the SensitiveValues object.
ResourceInstanceObjectSrc.Decodehandles marking the decoded values with any marks stored in
AttrSensitivePaths, therefore re-applying those marks is not necessary and causes the JSON failed issue.
- This issue was fixed in Terraform v1.0.2.
GitHub Issue - https://github.com/hashicorp/terraform/issues/29042
- Pull Request - https://github.com/hashicorp/terraform/pull/29049