Recall & Review
beginner
What is a sensitive variable in Terraform?
A sensitive variable is a variable that holds secret or private information, like passwords or keys, which Terraform hides from output to keep it safe.
Click to reveal answer
beginner
How do you declare a sensitive variable in Terraform?
You declare a variable with the attribute
sensitive = true inside the variable block to mark it as sensitive.Click to reveal answer
beginner
Why should sensitive variables not be printed in Terraform outputs?
Printing sensitive variables can expose secrets in logs or terminal, risking security. Terraform hides them to protect sensitive data.
Click to reveal answer
intermediate
Can sensitive variables be used in Terraform resource configurations?
Yes, sensitive variables can be used normally in resource configurations, but Terraform will avoid showing their values in plan or apply outputs.
Click to reveal answer
intermediate
What happens if you try to output a sensitive variable without marking the output as sensitive?
Terraform will warn you and hide the value in the output to prevent accidental exposure of secrets.
Click to reveal answer
How do you mark a variable as sensitive in Terraform?
✗ Incorrect
The correct way is to add
sensitive = true inside the variable block.What does Terraform do when you output a sensitive variable without marking the output as sensitive?
✗ Incorrect
Terraform hides the sensitive value and warns you to avoid exposing secrets.
Why should sensitive variables be used in Terraform?
✗ Incorrect
Sensitive variables keep secret information like passwords safe by hiding them.
Can you use sensitive variables inside resource definitions?
✗ Incorrect
Sensitive variables can be used normally in resources, but Terraform hides their values in outputs.
What is a best practice when handling sensitive variables in Terraform?
✗ Incorrect
Marking variables as sensitive and avoiding printing them protects secrets.
Explain how to declare and use sensitive variables in Terraform and why it is important.
Think about how you keep passwords safe in real life.
You got /4 concepts.
Describe what happens when you output a sensitive variable without marking the output as sensitive in Terraform.
Terraform acts like a privacy guard for secrets.
You got /3 concepts.