HashiCorp

Terragrunt Playground

Get access to the Terragrunt playground with one click

Welcome to our Terragrunt playground!

With our playground, you can start practicing and learning Terragrunt right away, without the need to set up your own environment or install any software.

What is Terragrunt?

In the real world, we write Terraform code in the form of modules. Modules are a way to easily organize, manage and reuse Terraform code. They help us reduce copying and pasting code across multiple configuration files. Yet, there are many cases where we still have to reuse the same code in multiple places. 

This is ok if we are working on a side project of our own. But imagine a real-world scenario, where we have to create and manage infrastructure across multiple environments such as testing, staging, and production. In such a case, manually copying and pasting code is not only tedious but also highly error-prone. Moreover, it leads to duplicate code that will be harder to maintain. For example, if we make a change to the code in one environment but forget to make the same change in another environment, the two environments will be different, leading to confusion and potential errors. If an issue arises in one of the environments, it can be difficult to troubleshoot the problem. Moreover, if we make a change to the code in one environment, it is harder to know if the change has been made in all the other environments where the code is duplicated, making it harder to track changes. 

This is where Terragrunt comes into the picture. Terragrunt helps us keep our configuration files DRY (Don’t Repeat Yourself). In other words, it helps us reduce duplication of Terraform code. With Terragrunt, we can deploy version-controlled Terraform code across multiple environments with minimal copying and pasting.

Terraform is a thin wrapper for Terraform, which means that we run all the standard Terraform commands, except we use terragrunt in place of terraform. For example:

  • terragrunt plan
  • terragrunt apply
  • terragrunt output

Terragrunt will run Terraform with the command we specify, but based on the configuration we specify in terragrunt.hcl files. Note that terragrunt.hcl files use the same HashiCorp Configuration language (HCL) as Terraform.

Playground Features

Our playground includes Visual Studio Code (a code editor) and comes pre-installed with Terraform and Terragrunt. It uses LocalStack to simulate the AWS environment.

Playground Notes

Note that you can use the playground for 1 hour. If required, you can extend the usage by 15 minutes by clicking on the icon next to the timer icon. 

So why wait? Get started now and have fun practicing!