While creating a new template, or editing one, you can specify the IaC versions you would like your template to use.
To associate a Template with a specific IaC version follow this:
- Go to the organization's Templates page.
- Click the Settings button of your desired Template.
- The Template Settings screen includes a
"Template Type" Versiondropdown. Associate your desired version with your Template.
- Click the Save button to commit your changes.
If you wish to choose a specific Terragrunt version the template's type must be Terragrunt.
Please note that changing this value in an existing template might affect running environments.
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.
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.
Updated about 2 months ago