Switching Terraform Versions Easily

Search for a command to run...

No comments yet. Be the first to comment.
Intro When working on a monolith and traffic increases, you might decide to start caching to manage the new volume. If your system is modern or small, you have several caching strategies: Handle the caching logic within the code by integrating somet...
The AWS CLI sync command is a powerful tool for copying new and updated files between a source and destination, with at least one of them being an S3 Bucket. This command can also be used to perform sync between S3 Buckets without the need to transit...

A tutorial using the AWS console

A Step Function Distributed Map and Lambda Demo

Amazon CloudFront CloudFront is Amazon’s offer for Content Delivery Network. The CDN is composed of a globally distributed set of caching servers that provide low latency and high throughput all around the world. The network is based on more than 300...

If you are working on multiple Terraform projects at once, you probably also manage multiple versions of the tool. You may stick to an older version for various reasons, one of the most common is breaking changes in Terraform. A clear example of breaking changes is the switch from HCL 1 to HCL 2 which requires some work to update the stack, so you may stick with an older version for some weeks.
If you are on MacOS or Linux there is a really useful tool written by warrensbox called tfswitch. You can find it on GitHub.
tfswitch allows you to easily switch between Terraform versions, and if you don't have the selected version yet, it will download and install it for you.
You can install tfswitch with homebrew:
brew install warrensbox/tap/tfswitch
You can install tfswitch with curl script:
curl -L https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh | bash