Articles in this section
- Taking a Terraform Enterprise backup with the API gives "502 Bad Gateway" error
- Terraform Enterprise - Invite users to multiple teams programmatically
- 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"
Related articles
- Error: "flatmap states cannot be unmarshaled..."
- Terraform Enterprise PostgreSQL SSLMODE
- Terraform CLI v0.11: Error installing provider "NAME": openpgp: signature made by unknown entity
- Using the .terraformignore file to exclude files from upload to HCP Terraform (formerly Terraform Cloud)
- TFE: import Terraform resources when VCS or API driven approach is used
Introduction
There may be cases where you may want to output the execution plan with a remote backend with Terraform Enterprise and HCP Terraform. The execution plan can be downloaded in JSON format using the plans API.
Expected Outcome
Retrieve the execution plan using the plans API.
Prerequisites
Procedure
run-id
, this is listed in the "Run Details" from the workspace.plan-id
, using the runs APINote: Replace the hostname in the examples below with your TFE hostname or if using HCP Terraform hostname should be app.terraform.io
plan-id
, retrieve the json execution planNote : 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.
Additional Information
Documentation:
Show a plan
Get run details