Locals in Detail
This lesson will cover Terraform local, how they work, and how to use them.
Terraform local
A local is Terraform’s representation of a normal programming language variable. Confusingly, Terraform also has a concept called a variable which is really an input (variables are covered in the variables chapter). A local can refer to a fixed value such as a string, or it can be used to refer to an expression such as two other locals concatenated together.
Project example
Let’s dive into an example:
Project code in detail
In the code above:
-
We define a local block by using the keyword
localsand then an opening{...