Articles in this section
- Taking a Terraform Enterprise backup with the API gives "502 Bad Gateway" error
- Unexpected resources being created when using tfe_provider
- Terraform Cloud/Enterprise API Not Returning All Data
- HTTP 412 Status Encountered When Uploading a New State File Version to Terraform Cloud/Enterprise
- "no migration found for version" Error Encountered After Using the Restore API to Restore Terraform Enterprise
- The User API Authentication Token Has Stopped Working
- How to get an execution plan with a remote backend
- TFE: Getting a 404 error when trying to create a GPG key resource
- Restore API error "413 Request Entity Too Large"
- Unprocessable Entity, Invalid Run Parameters Error with API Driven Workflow
Problem: You cannot use
-outfile
with a remote backend, but may want the execution plan.Solution: You can retrieve the
json execution plan
via this API call, but it requires admin permissions on the workspace.You can get the
plan-id
required by using the runs API and then use that plan to get the json execution planFor example the below curl command works when you are using an admin token
Note : The JSON plan contains potentially sensitive information, including the values of sensitive variables and copies of the prior and post-refresh state. This is why the JSON plan isn't accessible without elevated permissions.
Documentation:
Show a plan
Get run details