Integrating Conditional Logic into Terraform Configurations

Lab Steps

lock
Logging in to the Amazon Web Services Console
lock
Connecting to the Terraform Web based IDE
lock
Create Terraform Configuration with Conditional Logic

Ready for the real environment experience?

DifficultyIntermediate
Time Limit30m
Students100
Ratings
5/5
starstarstarstarstar

Description

As companies start to build infrastructure using Terraform, the logic required to build self-service automation becomes complex. That's why HCL (HashiCorp Configuration Language) contains expressions that can perform calculations within Terraform configurations. Integrating conditional logic into modules allows them to become dynamic and reusable for different scenarios. 

In this lab, you will create an EC2 Module that contains conditional logic for deploying an EC2 Instance. 

Learning Objectives

Upon completion of this lab you will be able to:

  • Understand how Terraform modules can be made dynamic for reusability
  • Learn about using conditional expressions within Terraform configurations

Intended Audience

This lab is intended for:

  • Individuals studying to take the HashiCorp Certified: Terraform Associate exam
  • Anyone interested in learning how to use Terraform to manage Cloud Service Providers

Lab Prerequisites

You should be familiar with:

  • Cloud Services
  • DevOps
  • Basic understanding of Terraform modules and variables

The following course and lab can be used to fulfill the prerequisites:

Environment before
PREVIEW
arrow_forward
Environment after
PREVIEW
About the Author
Students1434
Labs18
Courses1

Luke currently serves as a Cloud Labs Developer at Cloud Academy. His background is infrastructure development using Terraform. He is an Azure DevOps Engineer Expert, Azure Administrator Associate, and HashiCorp Certified - Terraform Associate.

Covered Topics