This message was deleted.
# atlantis-community
s
This message was deleted.
r
Copy code
terraform {
  # resolves to 1.0.9 (or whatever 1.0.x latest is)
  required_version = "~> 1.0.0"
}
Copy code
terraform {
  # resolves to 1.5.7 (or whatever 1.5.x latest is)
  required_version = "~> 1.5.0"
}
m
Hi RB, thanks for the response, but I'm unclear what you're saying exactly. I do understand the notation you specified above would give me those results, but I'm specifically curious about
required_version = ">= 1.0"
. Would we expect this to resolve to 1.5.7?
r
yes currently but when terraform 2.x is released, it will also resolve to that
also when 1.6.x is released, it will also resolve to that
m
OK, all of that makes sense. I guess I was expecting the
default-tf-version
to kick in when we don't specify the exact version in the repo.
c
Yeah,
default-tf-version
only kicks in when there are no constraints on which Terraform version to use. I got burned by this myself, unfortunately.
👍 2
☝️ 2
I'm trying to find the best way to deal with it because I would like to lock my Terraform versions down as well, but I don't think there's any good way to do it.
Aside from defining it for each root.
d
Part of the problem is the code to auto-download Terraform if one does not exist on top of the Terraform binaries that we auto-package with the docker image. I'd like to remove all of that confusing cruft and just let the user build their own on top and BYOT for consistency
m
Thanks everyone. Yeah I agree this is all confusing. I may reconfigure our Atlantis to disable auto download.
w
Probably mentioned in an earlier thread, but what we do (not the only / best way, just what we do) is to pin the version and use Renovate to keep it up to date. You could create some sort of pre-hook to remove the version file from some / all files before atlantis runs, though that seems a little kludgy.