Upgrading the terraform binary to a minor patch version

I am currently on 0.12.20 of terraform core. I want to upgrade the terraform core binary to 0.12.31 (to use the new hashicorp key). Is there a place where I can download the minor patch from? Can I have multiple terraform core installed and then chose a version using the version blocks?

All of the Terraform releases are available from https://releases.hashicorp.com/terraform/.

Here’s the link for 0.12.31: https://releases.hashicorp.com/terraform/0.12.31/

Can I maintain two versions of the binary and swap between them based on what I use in the terraform version block in the code?

I don’t think Terraform can run code conditionally for a specific version. But, someone else would need to comment on that to be sure.

Terraform itself cannot dynamically choose which version of itself to run based on your configuration, because it’s already running by the time it would be making that decision! But there are some third-party “version switching” tools which provide a few different variations on that.

This is a non-exhaustive list of tools I can think of right now; I can’t recommend either of them in particular, and would encourage you to look for other tools I might not know about too.

Thank you. This is very helpful.