Skip to content

Terraform Versions

Terrateam Configuration Terrateam behavior can be configured via a config.yml. This file is located in a directory named .terrateam at the root of your Terraform repository: .terrateam/config.yml.

See Configuration documentation for details.

Terraform Versions

Multiple versions of the Terraform CLI can be configured to be used for Terrateam operations. There are multiple ways to specify the version. The versions are evaluated in the order described below where the version is taken from the first match.

  1. A .terraform-version file in the directory terraform is being executed in, for example prod/ec2/.terraform-version.
  2. A .terraform-version file in the root directory of the repository.
  3. A custom workflow in .terrateam/config.yml.
  4. The default_tf_version in .terrateam/config.yml.

.terraform-version in the Directory

A version can be specified in the .terraform-version file in any directory. When terraform is executed, the specified version will be used.

.terraform-version in the Root Directory

A .terraform-version file can also be put in the root directory of the repository.

Workflows

The Terraform version can be specified in a workflow:

dirs:
  ec2/us-east-1/production:
    tags: [ec2, us-east-1, production]
  ec2/us-west-1/production:
    tags: [ec2, us-west-1, production]
workflows:
  - tag_query: ec2 us-east-1 production
    terraform_version: 1.2.2
  - tag_query: ec2 us-west-1 production
    terraform_version: 0.15.5

Default Version

A default version can be specified in the .terrateam/config.yml file.

default_tf_version: 1.2.2