Terraform Variables: Local and Environment

Learn about Terraform's local and environment variables and how to work with them.

Overview

One of the advantages of writing our infrastructure as code is the ability to use variables to store values as we require. The ability to use just a single configuration for different target environments enhances the flexibility of IaC. The code below shows the syntax to create a variable in Terraform:

Get hands-on with 1200+ tech skills courses.