Introduction
How Buddy runs Terraform and OpenTofu: native Plan, Apply, and Drift Detection actions with a resource diff, plus the Terraform CLI action for any command.
Quick start
Build your first Terraform pipeline in Buddy: plan with OpenTofu, approve the diff, and apply it, with state kept in a Buddy artifact.
TF & OpenTofu tools
Choose the tool for Terraform actions in Buddy: OpenTofu, open-source Terraform, or a custom binary in your own Docker image, and pin the version to run.
Plan and Apply
How the Terraform Plan and Apply actions in Buddy work: generated commands, the plan file, the structured resource diff, extra arguments, and conditional apply.
State backends
Where the Terraform state lives in Buddy pipelines: a Buddy artifact with locking, S3 or GCS with integration credentials, or your own backend.
Credentials and variables
Give Terraform actions in Buddy access to AWS and Google with integrations, keep secrets in Buddy variables, and pass inputs with TF_VAR_ and tfvars files.
Workspaces and environments
Run one Terraform configuration against several environments in Buddy with workspaces, separate state backends, or one pipeline per directory.
Drift detection
Find infrastructure changed or removed outside of Terraform with the Drift Detection action in Buddy: run it on a schedule and get notified about drift.
Terraform CLI action
Run any Terraform command in a Buddy pipeline with the Terraform CLI action: fmt, validate, import, state, and output, with the same backends as Plan and Apply.
Output variables
Variables exported by the Terraform Plan, Apply, and Drift Detection actions in Buddy: change counters, summaries, destroyed resources, and how to use them.
Common workflows
Ready-made Terraform pipelines for Buddy: plan on pull requests, destroy behind an approval, import existing resources, and lint and scan before planning.
Troubleshooting
Fixes for common Terraform problems in Buddy: missing plan file, Apply on the wrong state, artifact not found, stale plans, image tags, and state locks.