Recall & Review
beginner
What is drift detection in the context of CI/CD?
Drift detection is the process of identifying differences between the desired infrastructure state defined in code and the actual state running in the cloud or environment.
Click to reveal answer
beginner
Why is drift detection important in Terraform-based CI/CD pipelines?
It ensures that the infrastructure matches the code, preventing unexpected changes or errors caused by manual updates or external modifications.
Click to reveal answer
beginner
Which Terraform command is commonly used to detect drift?
The command
terraform plan compares the current infrastructure state with the configuration files and shows any differences.Click to reveal answer
intermediate
How can drift detection be automated in a CI/CD pipeline?
By running
terraform plan as part of the pipeline and failing the build if unexpected changes are detected.Click to reveal answer
beginner
What is a common real-life analogy for drift detection?
It's like checking your house keys against a checklist before leaving to make sure nothing is missing or changed unexpectedly.
Click to reveal answer
What does Terraform's
terraform plan command do in drift detection?✗ Incorrect
terraform plan compares the current infrastructure state with the configuration and shows any differences, helping detect drift.
Why should drift detection be part of a CI/CD pipeline?
✗ Incorrect
Including drift detection in CI/CD helps catch infrastructure changes that don't match the code, avoiding errors.
What happens if drift is detected during a CI/CD pipeline run?
✗ Incorrect
Failing the pipeline on drift detection alerts the team to fix the mismatch before deployment.
Which of these is NOT a cause of drift?
✗ Incorrect
Unchanged configuration files do not cause drift; drift happens when actual state differs from code.
What is a simple way to fix drift once detected?
✗ Incorrect
Applying the Terraform configuration updates the infrastructure to match the code, fixing drift.
Explain what drift detection is and why it matters in a Terraform CI/CD pipeline.
Think about how code and real infrastructure can get out of sync.
You got /3 concepts.
Describe how you would automate drift detection in a CI/CD pipeline using Terraform commands.
Consider what commands show differences and how the pipeline should respond.
You got /3 concepts.