Template IaC Version

While creating a new template, or editing one, you can specify the IaC versions you would like your template to use.

Selecting a Specific IaC version

To associate a Template with a specific IaC version follow this:

  1. Go to the organization's Templates page.
  2. Click the Settings button of your desired Template.
  3. The Template Settings screen includes a "Template Type" Version dropdown. Associate your desired version with your Template.
  4. Click the Save button to commit your changes.

If you wish to choose a specific Terragrunt version the template's type must be Terragrunt.

Terraform, OpenTofu and Terragrunt Version


Existing Templates

Please note that changing this value in an existing template might affect running environments.

Resolve Version From Terraform Code

You can specify the special value called "Resolve from terraform code".
By doing so, env0 will automatically resolve the right version for you, by extracting the version from your code, using tfenv min-required option.

Overriding By Environment Variables

Defining an IaC version is also possible by using environment variables,

  • For Terraform using the environment variable ENV0_TF_VERSION, you can specify the Terraform version you would like your environment to use. It will override the existing value that exists in the template's dropdown.
  • For Terragrunt there also exists an environment variable - ENV0_TERRAGRUNT_VERSION. You can read more here.
  • For Pulumi using the environment variable ENV0_PULUMI_VERSION, you can specify the Pulumi version your environment would use.
  • For OpenTofu using the environment variable ENV0_OPENTOFU_VERSION, you can specify the OpenTofu version your environment would use.