Skip to content
If you like Terrateam, give us a star 🌟 on GitHub.

Choosing and Configuring an Engine

Terrateam supports multiple execution engines, giving you the flexibility to choose the right tool for your workflow. Whether you are using standard Terraform, OpenTofu, Terragrunt, CDKTF, or even a fully custom engine, Terrateam makes it possible to configure plan and apply behavior that suits your needs.

You can define the engine globally or override it per workflow by using the engine key in your .terrateam/config.yml file.

Built In Engine Types

Terraform (default)

engine:
name: terraform

OpenTofu

engine:
name: tofu
version: 1.9.0

Terragrunt

engine:
name: terragrunt
tf_version: 1.11.1

CDKTF

engine:
name: cdktf
tf_cmd: tofu

Pulumi

engine:
name: pulumi

Custom Engine

Example

engine:
name: custom
init: ['echo', 'init']
plan: ['touch', '$TERRATEAM_PLAN_FILE']
diff: ['printf', '+ added foo\n- removed bar\n~ updated bar\n']
apply: ['cat', 'foo.txt']
outputs: ['echo', '{"foo": "bar"}']

How It Works

Each key corresponds to a step in the Terrateam workflow:

  • init The command to run during the init step. Optional.
  • plan The command to run during the plan step. Must write to the path specified by the TERRATEAM_PLAN_FILE environment variable. Required.
  • diff The command to produce a human-readable diff of the plan output. Optional.
  • apply The command to run during the apply step. Optional.
  • outputs The command to return output values as a JSON string. Optional.

Only define the steps that make sense for your use case. All others can be omitted.

Per Workflow Engines

If you have different workflows (for example, dev and prod), you can override the engine configuration per workflow. Just nest the engine block inside a workflow definition.

workflows:
- tag_query: "development"
engine:
name: tofu
- tag_query: "production"
engine:
name: terraform

Best Practices

  • Use per-workflow engine configurations to maximize flexibility.
  • Use tf_version and tf_cmd to control which Terraform compatible CLI is invoked.
  • For custom engines, test locally with the same environment variables Terrateam uses (especially TERRATEAM_PLAN_FILE).