Overview
When creating or editing a template, you can specify which version of Infrastructure as Code (IaC) tools to use for your deployments. env zero supports version management for Terraform, OpenTofu, Terragrunt, Pulumi, and Ansible.Version Resolution Order
When determining which version to use, env zero follows this priority order:- Environment Variables (
ENV0_TOOL_VERSIONEnvironment Variable) - Version Files (
.tool-versionrepository file) - Template Settings (Specified in UI)
Version Specification Methods
1. Environment Variables
You can override the template version setting using environment variables:| IaC Tool | Environment Variable |
|---|---|
| Terraform | ENV0_TERRAFORM_VERSION |
| OpenTofu | ENV0_OPENTOFU_VERSION |
| Terragrunt | ENV0_TERRAGRUNT_VERSION |
| Pulumi | ENV0_PULUMI_VERSION |
| Ansible | ENV0_ANSIBLE_VERSION |
2. Version Files
env zero can automatically detect versions from standard version files located under the directory you configure in the template. If you want to reuse the same version files for multiple folders, set the environment variable ENV0_RESOLVE_FILE_VERSION_RECURSIVELY=true.| IaC Tool | Version File |
|---|---|
| Terraform | .terraform-version |
| OpenTofu | .opentofu-version |
| Terragrunt | .terragrunt-version |
| Ansible | .ansiable-version |
| Pulumi | .pulumi-version |
3. Template Settings
To associate a specific IaC version with a template:- Open the relevant Template.
- Go to the Settings tab and expand Advanced Settings.
- Select the desired version from the
"Template Type" Versiondropdown. - Click Save.

Special Version Values
Automatic Version Detection
When selecting a version in the template settings, you can choose special values:- Terraform: “Resolve from code” - Automatically detects and uses the minimum required version specified in your Terraform code’s
required_versionconstraint - OpenTofu: “Resolve from code” - Similar to Terraform, extracts required version from your code
The version value for automatic detection is
RESOLVE_FROM_CODE.
Latest Version
You can specify “latest” for supported IaC tools:- Terraform: Latest version up to 1.5.x
- Pulumi: Latest available version
- OpenTofu: Latest available version
- Ansible: Latest available version
The version value for automatic detection is
latest.