hands-on lab

Managing Google Cloud Platform Environments with Terragrunt

Difficulty: Advanced
Duration: Up to 30 minutes
Students: 215
Rating: 5/5
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.

Description

In a real-world setting, development and production environments are configurations that are logically separated in order to detect and address potential threats throughout the delivery process. Although these environments are separate, it's common for them to mirror one another. With this mirroring of configurations, developers tend to copy and paste majority of the environment configurations. This process is time consuming, and when done manually, they can be prone to error.

Terraform provides the ability to import remote module definitions in order to cut down on the process of duplicating similar environments. Terragrunt can be used on top of this functionality to configure the differing values of each environment from a single file in the project directory.

In this lab, you will learn how to use Terragrunt environment variables to simplify the deployment process to separate Google Cloud Platform (GCP) environments.

Learning Objectives

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

  • Learn how to simplify deployments to separate Google Cloud Platform environments with Terragrunt

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

Prerequisites

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

  • Basic concepts of Google Cloud Platform
  • Basic concepts of Terraform
  • Managing remote state with Terragrunt
  • Passing output variables between Terraform modules

The following content can be used to fulfill the prerequisite:

Updates

June 9th, 2023 - Updated instance image

April 28th, 2023 - Updated theia to include autosave

Environment before

Environment after

Covered topics

Lab steps

Activating the Google Cloud Platform Service Account
Deploying Google Cloud Platform Resources Using Remote Terraform Modules
Modifying Environment Configurations with Terragrunt