Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Terragrunt - make your Terraform code DRY
Rating: 4.2 out of 5(79 ratings)
2,879 students

Terragrunt - make your Terraform code DRY

How to make your infrastructure as a code cleaner and easier to maintain with Terraform and Terragrunt
Created byPaweł Tokarz
Last updated 6/2026
English
English [Auto],

What you'll learn

  • How to make your Terraform code DRY with Terragrunt
  • Eliminate code duplication by centralizing common configurations and reusing them across different modules and environments.
  • Simplify infrastructure management with Terragrunt's ability to handle complex setups, including multi-environment and multi-account deployments.
  • Master the use of hooks and dependency management to automate workflows and ensure smooth execution of Terraform commands.
  • Implement best practices for maintaining a clean, modular, and maintainable codebase that scales effortlessly as your infrastructure grows.
  • Advanced use cases with Terragrunt
  • How to better manage resources as a code with a Terraform
  • Structure your Terraform code

Course content

5 sections • 45 lectures • 5h 29m total length
  • Why Terragrunt?3:05

    Why should you consider adding Terragrunt to your IaC stack?

  • Terragrunt installation2:29

    Explore three Terragrunt installation methods for Linux and macOS: system package managers, downloading the binary from GitHub, and the Homebrew approach, with notes on version management challenges.

  • Multiple version of Terragrunt and Terraform2:21

    Explore why and how to manage multiple versions of Terragrunt and Terraform to accommodate dependencies, environment isolation, dev to prod rollouts, and legacy systems.

  • Easy switching between versions2:26
  • Easy switching between versions - installation demo4:55

    Learn three ways to install and switch versions of a tool: Homebrew installation, a script with sudo for /usr/local/bin, and direct GitHub releases, then verify by checking versions.

  • Easy switching between versions - "in action" demo4:24

    Explore how to manage multiple Terraform and Terragrunt versions using switch. See how symlinks and cached downloads let you switch quickly, including semi-automatic switching from project configuration.

  • Terragrunt - basic setup3:42

    Terragrunt runs Terraform under the hood, enabling a basic setup that mirrors Terraform operations and demonstrates module sources, inputs, outputs, and a simple file resource.

  • Terragrunt - basic setup demo3:41

    Demonstrates a terragrunt basic setup using a simple module and environment with terraform, showing a local file resource, input and outputs, and an easy apply workflow.

  • Terragrunt - blocks explained9:06

    Explore Terragrunt blocks like Terraform, remote state, include, dependency, dependencies, generate, locals, and inputs, and learn how to configure sources, dynamic generation, and module dependencies to keep Terraform dry.

  • Terragrunt - flow5:45

    Follow the terragrunt flow as it wraps terraform, copies the current directory into a cache, generates configuration, and exports inputs as environment variables before running terraform and updating remote state.

  • Terragrunt basics
  • Terragrunt blocks
  • Materials (Github)0:08

Requirements

  • Terraform, Linux, Bash, Command line, AWS, Vault
  • Basic Knowledge of Terraform: Familiarity with Terraform's core concepts, such as infrastructure as code (IaC), modules, and state management, is essential. Experience with writing and deploying Terraform configurations will help you understand how Terragrunt enhances Terraform workflows
  • Experience with Cloud Platforms: Understanding how to deploy infrastructure on cloud platforms like AWS, Azure, or Google Cloud will be beneficial, as the course will involve real-world scenarios using cloud providers
  • Version Control and Automation Practices: Basic knowledge of version control systems like Git and automation practices will be helpful for managing Terraform code across multiple environments and versions

Description

Welcome to my course on Terragrunt!


We are going to learn how to maintain our Terraform code in better way. We will focus on how to work on Terragrunt modules, extract common parts for provider, remote state and modules itself. We will start with the basics, understand blocks that we have inside the Terragrunt. We will use some built-in functions. After that we are going to focus on why and how move to the next level, so called DRY approach (Don't repeat yourself approach).


We will do live examples for:

- Plain Terraform (aka dummy modules and environments just to look around)

- Hashicorp Vault setup

- AWS setup


Streamline Your Terraform Workflows with Terragrunt!

Learn how to eliminate repetitive code, manage complex infrastructures, and scale your Terraform projects effortlessly. This course will teach you to leverage Terragrunt's powerful features to keep your Terraform configurations DRY (Don't Repeat Yourself) and maintainable across multiple environments. Perfect for DevOps and Cloud Engineers looking to optimize their infrastructure as code practices.


I truly believe that with examples in the course and knowledge I'm going to pass over to you - you will be able to apply it to any environments you are currently maintain. Example is this course are related to AWS and Vault, but approaches presented here are relative to any cloud or provider that you are using.


Disclamer:

This course is not going to learn you how to work with Terraform basics. It learns you how to leverage your Terraform skills with Terragrunt wrapper and Gruntwork team mindset.


I hope you will enjoy it and level up your infrastructure as a code!

Who this course is for:

  • DevOps Engineers: Professionals responsible for managing and automating infrastructure who want to streamline their Terraform workflows and handle complex, multi-environment setups more efficiently
  • Cloud Engineers: Individuals working with cloud platforms (AWS, Azure, GCP) who need to manage infrastructure as code and are looking to reduce code duplication and improve state management across environments
  • Admins, DevOps, Infrastructure Engineers and Developers that manages infrastructure as code
  • Terraform Users: People with foundational knowledge of Terraform or similar tools (like OpenTofu) who are seeking to enhance their skills by learning how to make their configurations more modular, reusable, and maintainable using Terragrunt
  • Infrastructure Automation Enthusiasts: Those interested in improving their automation practices by learning how to manage dependencies, remote state, and environment configurations in a scalable, DRY manner
  • Terraform and Terragrunt users
  • Those that manage Infrastructure