Installing latest provider version with Terraform 0.13

How to install the latest version of any provider with Terraform 0.13? It enforces version pinning, though having “latest” version sometimes is also handy.

Perhaps I’m misunderstanding what you’re asking here, but Terraform 0.13 doesn’t enforce version pinning as far as I understand it.

Terraform provider version constraints can be used to specify “at least this version” using the >= operator. That will result in installing the “latest” version every time you run terraform init.

For example:

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 3.0.0"
    }
  }
}

This constraints Terraform to use any version after 3.0.0, which at time of writing results in installing 3.6.0.

Looks like a solution to me. Thank you