Exploring Terraform Variables

View some of the basic variables in Terraform corresponding to AWS.

Viewing variables in Terraform

Generally speaking, entries in Terraform definitions are split into four groups:

  • Provider
  • Resource
  • Output
  • Variable

That’s not to say that there aren’t other types (there are) but those four are the most important and the most commonly used. For now, we’ll focus on variables and leave the rest for later.

Note: All the configuration files we’ll need are in the file subdirectory. We’ll pull them out one by one and explore what they’re used for.

Let’s look at the definition of variables.tf.

Get hands-on with 1200+ tech skills courses.