Files
atlantis/runatlantis.io/docs/terraform-versions.md
dependabot[bot] d71e873d52 chore(deps): bump rollup from 4.18.0 to 4.22.4 (#4956)
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rui Chen <rui@chenrui.dev>
2024-09-26 21:54:15 -04:00

2.1 KiB

Terraform Versions

You can customize which version of Terraform Atlantis defaults to by setting the --default-tf-version flag (ex. --default-tf-version=v1.3.7).

Via atlantis.yaml

If you wish to use a different version than the default for a specific repo or project, you need to create an atlantis.yaml file and set the terraform_version key:

version: 3
projects:
- dir: .
  terraform_version: v1.1.5

See atlantis.yaml Use Cases for more details.

Via terraform config

Alternatively, one can use the terraform configuration block's required_version key to specify an exact version (x.y.z or = x.y.z), or as of atlantis v0.21.0, a comparison or pessimistic version constraint:

Exactly version 1.2.9

terraform {
  required_version = "= 1.2.9"
}

Any patch/tiny version of minor version 1.2 (1.2.z)

terraform {
  required_version = "~> 1.2.0"
}

Any minor version of major version 1 (1.y.z)

terraform {
  required_version = "~> 1.2"
}

Any version that is at least 1.2.0

terraform {
  required_version = ">= 1.2.0"
}

See Terraform required_version for reference.

::: tip NOTE Atlantis will automatically download the latest version that fulfills the constraint specified. A terraform_version specified in the atlantis.yaml file takes precedence over both the --default-tf-version flag and the required_version in the terraform hcl. :::

::: tip NOTE The Atlantis latest docker image tends to have recent versions of Terraform, but there may be a delay as new versions are released. The highest version of Terraform allowed in your code is the version specified by DEFAULT_TERRAFORM_VERSION in the image your server is running. :::