Terraform HCP Remote and CI Cheat Sheet/Save plan as pipeline artifact

Persist both binary and JSON plan outputs for later review or policy checks.

Section: Governance and Team Workflows

Save plan as pipeline artifact

bash
bash
terraform plan -out=tfplan && terraform show -json tfplan > tfplan.json
Explanation

Persist both binary and JSON plan outputs for later review or policy checks.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Governance and Team Workflows
Basic validation step
Common fast feedback step before plan/apply.
OpenIn sheetbashsame section
Plan without color
Disable ANSI color codes for cleaner CI logs.
OpenIn sheetbash3 tag match
Apply for CI
Apply non-interactively in automation.
OpenIn sheetbash2 tag match
Custom TF_DATA_DIR in CI
Isolate Terraform local data in ephemeral build environments.
OpenIn sheetbash2 tag match
Init for CI
Avoid interactive backend/provider prompts in automation.
OpenIn sheetbash2 tag match
Alternate CLI config file
Use a project-specific CLI configuration in CI or containers.
OpenIn sheetbash2 tag match