Testing Google Cloud Platform Modules with Terratest

Lab Steps

lock
Activating the Google Cloud Platform Service Account
lock
Writing a GCP Module Test Using Terratest

The hands-on lab is part of this learning path

Ready for the real environment experience?

DifficultyAdvanced
Time Limit45m
Students76
Ratings
5/5
starstarstarstarstar

Description

Developing cloud infrastructure applies the common software development practice of automated testing in order to ensure resources are being configured correctly and staying within the project's requirements. The increasing pace of cloud providers like Google Cloud Platform is a major reason to include these types of tests in your infrastructure development process. The process of configuring a resource today may not be the same as it was six months ago, and in most cases, automated tests are the only way to identify these updates. Another benefit of implementing testing is to ensure that future updates to your resources don't affect your overall infrastructure.

Terratest, is an open-source Golang testing library that enables you to set up tests for your Terraform resources and modules. Terratest can provide peace of mind as your infrastructure grows and can safeguard your infrastructure from many breaking updates.

In this lab, you write a test using the Terratest library that validates a Google Cloud Platform module configuration.

Learning Objectives

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

  • Learn how to write tests to validate your Google Cloud Platform resource modules with Terratest

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

The following content can be used to fulfill the prerequisite:

Environment before
PREVIEW
arrow_forward
Environment after
PREVIEW
About the Author
Students18626
Labs58
Learning paths3

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.