Exploring Terraform Variables
Explore how Terraform variables define and manage critical parameters like region, Kubernetes version, and node counts for AWS EKS clusters. Understand the role of default and runtime variable values in creating scalable, customizable infrastructure as code setups.
We'll cover the following...
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.
If we focus on the names of the variables, we’ll notice that they are self-explanatory: