Variables
Explore how to declare variables in Terraform and use them to make configurations dynamic. Understand variable syntax, passing runtime values, setting descriptions, and how Terraform prompts for inputs during apply or destroy actions. This lesson helps you manage variable-driven infrastructure effectively.
We'll cover the following...
Terraform variables
A variable in Terraform is something that can be set at runtime. It allows you to vary what Terraform will do by passing in or using a dynamic value.
Our first Variable
Let’s dive into an example of how to use variables so we can learn how they work:
You declare a variable by using the keyword variable, and then specify the identifier for the variable in quotes. We are using "bucket_name" as the identifier. Inside the variable block, we add a description to describe to the user what ...