Which statement best explains why variables make Terraform configurations reusable?
Think about how you can use the same recipe but change ingredients easily.
Variables let you customize values like names or sizes without changing the main code, making it reusable for different setups.
You have a Terraform module that creates a virtual machine. How do variables help you reuse this module for different projects?
Think about how you can use the same tool but adjust settings for each use.
Variables let you customize inputs like VM name and size, so the same module works for many projects without code changes.
Given this Terraform snippet, what will be the value of resource_name after applying?
variable "env" { default = "prod" } variable "app" { default = "web" } output "resource_name" { value = "${var.app}-${var.env}-01" }
Look at how the variables are combined in the output value.
The output concatenates var.app, var.env, and "01" in that order, so the result is "web-prod-01".
Which reason best explains why marking variables as sensitive improves security in Terraform?
Think about how you keep passwords hidden when sharing information.
Marking variables as sensitive stops Terraform from showing their values in logs or outputs, protecting secrets like passwords.
Consider a Terraform configuration with a variable declared without a default value. What will Terraform do if you run terraform apply without providing this variable?
Think about how Terraform handles missing required inputs interactively.
Terraform asks the user to input a value for any variable without a default before it can continue applying changes.