https://rancher.com/ logo
Title
q

quiet-author-51481

05/04/2023, 10:05 AM
Hey, Maybe a simple question, but: how can I specify the version of terraform provider to be used (i.e I would like to use Rancher Terraform provider: 1.24.0) in the .tf files?
q

quiet-author-51481

05/04/2023, 10:12 AM
Thanks, I have a version.tf with
terraform {
  required_version = ">= 1.3"
}
which generates tf.lock.hcl :
provider "<http://registry.terraform.io/rancher/rancher2|registry.terraform.io/rancher/rancher2>" {
  version     = "3.0.0"
  constraints = ">= 1.24.1"
and I can see the
3.0.0
version being used from tf logs:
DEBUG] provider.terraform-provider-rancher2_v3.0.0: 2023/05/04 13:00:21 [INFO] Creating Cluster XXX
So, I have to specify the required_version in version.tf a bit differently probably
But I am not understanding how this mapping matrix is working, is there a table for that? in other words, how would I find out the needed
required_version
for specific rancher provider version
s

sparse-fireman-14239

05/04/2023, 10:16 AM
It's a provider version, not K8s version
q

quiet-author-51481

05/04/2023, 10:18 AM
yes, and both are available: v3.0.0 & v1.24.2
though I am not sure why it was previously following the k8s version for provider and then stopped it after v1.25.0 release (next release versioning is v2.0.0-rc1)
s

sparse-fireman-14239

05/04/2023, 10:20 AM
It's probably in the docs/release notes
q

quiet-author-51481

05/04/2023, 10:36 AM
Not really, but for anyone who could stumble upon this in the future, you can tune the
required_version
as following:
terraform {
  required_version = "<= 1.24.3"
}
and it will install the provider version v1.24.2