hands-on lab

Centralizing Remote State with Terragrunt in GCP

Up to 45m
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.


As a Terraform project grows, the resource configurations become harder to update and manage. At a certain point, it's beneficial for the team to begin using additional tooling to assist with the management.

Terragrunt is an open-source tool that acts as a thin wrapper around Terraform, enabling configurations to be more in line with DRY. DRY is a popular software development practice that stands for "Don't Repeat Yourself," which means don't re-use the same software pattern, avoiding redundancy. Terragrunt adds a feature that allows Terraform remote state configurations to be defined once in code and re-used throughout multiple Terraform projects.

In this lab, you will use Terragrunt to deploy a Terraform configuration in separate Google Cloud Platform environments while keeping the remote state configuration DRY.

Learning Objectives

Upon completion of this lab, you will be able to:

  • Learn how to deploy Google Cloud Platform resources with Terragrunt
  • Configure Terraform remote state in a centralized location within a project directory

Intended Audience

  • Individuals and teams looking for ways to scale their Terraform codebase with Terragrunt
  • Individuals and teams seeking an introduction to using Terragrunt with Google Cloud Platform


Familiarity with the following will be beneficial but is not required:

  • Basic concepts of Google Cloud Platform
  • Basic concepts of Terraform

The following content can be used to fulfill the prerequisite:


April 28th, 2023 - Updated theia to include autosave

Environment before

Environment after

About the author

Jun Fritz, opens in a new tab
Cloud Labs Developer
Learning paths

Jun is a Cloud Labs Developer with previous experience as a Software Engineer and Cloud Developer. He holds the AWS Certified Solutions Architect and DevOps Engineer Professional certifications. He also holds the AWS Certified Solutions Architect, Developer, and SysOps Administrator Associate certifications. 

Jun is focused on giving back to the growing cloud community by sharing his knowledge and experience with students and creating engaging content. 

Covered topics

Lab steps

Activating the Google Cloud Platform Service Account
Managing Remote State with Terragrunt in GCP