Recall & Review
beginner
What is the purpose of a
terraform.tfvars file?It is used to set variable values for a Terraform configuration, allowing you to customize deployments without changing the main code.
Click to reveal answer
beginner
How does Terraform use the
terraform.tfvars file during deployment?Terraform automatically loads
terraform.tfvars to assign values to variables when you run commands like terraform apply.Click to reveal answer
intermediate
Can you have multiple
.tfvars files? How do you specify which one to use?Yes, you can have multiple
.tfvars files. Use the -var-file option with Terraform commands to specify which file to load.Click to reveal answer
beginner
What is the correct format to assign a string variable in
terraform.tfvars?Use
variable_name = "value" with quotes around the string value.Click to reveal answer
intermediate
Why is it a best practice to exclude
terraform.tfvars from version control?Because it often contains sensitive or environment-specific data like passwords or keys, excluding it helps keep secrets safe.
Click to reveal answer
What file does Terraform automatically load to set variable values?
✗ Incorrect
Terraform automatically loads terraform.tfvars to assign variable values.
How do you specify a different variable file when running Terraform commands?
✗ Incorrect
Use the -var-file option to specify a different variable file.
Which of these is the correct way to assign a number variable in
terraform.tfvars?✗ Incorrect
Numbers are assigned without quotes, like count = 3.
Why might you want to keep
terraform.tfvars out of version control?✗ Incorrect
Because it often contains sensitive or environment-specific data.
If you have a variable
region, how do you set it in terraform.tfvars?✗ Incorrect
Strings must be in quotes: region = "us-west-2".
Explain what a
terraform.tfvars file is and why it is useful.Think about how you tell Terraform what values to use without changing the main code.
You got /4 concepts.
Describe best practices for managing sensitive data in
terraform.tfvars files.Consider how to keep passwords or keys safe when using Terraform.
You got /4 concepts.