Logo

dev-resources.site

for different kinds of informations.

Easy Baking with OpenTofu and Terragrunt: A Simple Guide

Published at
10/13/2023
Categories
opentofu
terragrunt
opensource
devops
Author
theexile110
Author
11 person written this
theexile110
open
Easy Baking with OpenTofu and Terragrunt: A Simple Guide

OpenTofu can now be installed via Homebrew.
Let's install it in a few easy steps and use it together with Terragrunt.

Install OpenTofu

First, let's install OpenTofu.

brew install opentofu

tofu -v
OpenTofu v1.6.0-dev
on linux_amd64
Enter fullscreen mode Exit fullscreen mode

Install Terragrunt

Next, let’s install Terragrunt.
With tgenv, we can easily install and manage Terragrunt versions.
Please note to use version 0.52.0 or higher.

brew install tgenv

tgenv install 0.52.0
tgenv use 0.52.0

terragrunt -v
terragrunt version v0.52.0
Enter fullscreen mode Exit fullscreen mode

Configure Terragrunt

Lastly, let's configure Terragrunt.
We can tell Terragrunt to use OpenTofu by setting the TERRAGRUNT_TFPATH environment variable.

echo 'export TERRAGRUNT_TFPATH=tofu' >> ~/.zshrc
source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Conclusion

Now, we are all set to use OpenTofu and Terragrunt.
Let's start using them!

Featured ones: