DEV Community

Cover image for Easy Baking with OpenTofu and Terragrunt: A Simple Guide
RUI
RUI

Posted on

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!

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay