Recall & Review
beginner
What is a Terraform state file?
A Terraform state file is a file that keeps track of the resources Terraform manages. It stores information about the infrastructure's current state so Terraform knows what to create, update, or delete.
Click to reveal answer
beginner
Why is the Terraform state file sensitive?
The state file contains detailed information about your infrastructure, including resource IDs, IP addresses, and sometimes secrets or passwords. If exposed, it can lead to security risks.
Click to reveal answer
intermediate
Name one best practice to secure Terraform state files.
Store the state file remotely in a secure backend like AWS S3 with encryption and access controls, instead of keeping it locally on your computer.
Click to reveal answer
intermediate
What is Terraform remote state locking and why is it important?
Remote state locking prevents multiple people from changing the state file at the same time. This avoids conflicts and corruption of the state file.
Click to reveal answer
advanced
How can you avoid storing sensitive data in the Terraform state file?
Use Terraform's sensitive variables feature and avoid outputting secrets. Also, use external secret managers to keep secrets outside the state file.
Click to reveal answer
What does the Terraform state file primarily store?
✗ Incorrect
The state file stores information about the current infrastructure resources Terraform manages.
Why should Terraform state files be stored securely?
✗ Incorrect
State files contain sensitive details like resource IDs and sometimes secrets, so securing them is important.
Which backend is recommended for storing Terraform state securely?
✗ Incorrect
Using a remote backend with encryption and access control protects the state file from unauthorized access.
What problem does remote state locking solve?
✗ Incorrect
Remote state locking prevents concurrent edits that could corrupt the state file.
How can you keep secrets out of the Terraform state file?
✗ Incorrect
Using sensitive variables and external secret managers keeps secrets out of the state file.
Explain why Terraform state files are sensitive and how you can protect them.
Think about what info the state file holds and how to keep it safe.
You got /5 concepts.
Describe best practices to avoid exposing sensitive data in Terraform state files.
Focus on how to handle secrets and state storage.
You got /5 concepts.