Hello, I’m following the provider versioning tutorial found at the time of writting here.
In the section called Explore versions.tf it provides a sample code inside of the versions.tf file.
Explore
versions.tfOpen the
versions.tffile. Here you will find theterraformblock which specifies the required provider version and required Terraform version for this configuration.terraform { required_providers { random = { source = "hashicorp/random" version = "3.0.0" } aws = { source = "hashicorp/aws" version = ">= 2.0.0" } } required_version = ">= 0.14"}The
terraformblock contains therequired_providersblock which specifies the provider local name, the source address and the version.When you initialize this configuration, Terraform will download:
- Version 3.0.0 of the random provider.
- The latest version of the AWS provider that is at greater than 2.0. The
>=version constraint operator specifies the minimum provider version that’s compatible with the configuration.In addition, the Terraform block specifies only Terraform binaries that are v0.14.x can run this configuration. The
~>operator is a convenient shorthand for allowing only patch releases within a specific minor release.
Both the documentation and the git repo have required_version = “>= 0.14”} and make mention of:
In addition, the Terraform block specifies only Terraform binaries that are v0.14.x can run this configuration. The [
~>operator]
I believe the repo and the code example in the page should be required_version = “~> 0.14”}.
I wasn’t certain where else to post the feedback.