Practice the vocabulary for discussing infrastructure drift, state management, and remediation in English.
0 / 15 completed
1 / 15
An engineer says the production security group has drifted. What does this mean?
Infrastructure drift means real infrastructure no longer matches the IaC definition — typically due to manual changes or changes by other tools.
2 / 15
A team decides to import existing AWS resources into Terraform state. What does terraform import do?
terraform import is used to bring pre-existing resources under Terraform management without recreating them.
3 / 15
What is the risk of running terraform apply when significant state drift is present?
Applying when drift exists can cause Terraform to destroy or replace drifted resources to bring them back to the defined state — potentially disruptive.
4 / 15
What does state locking prevent in a team Terraform workflow?
State locking (via DynamoDB on AWS or Terraform Cloud) ensures only one operation modifies the state at a time, preventing corruption.
5 / 15
A colleague proposes using targeted applies (--target) to remediate drift on a specific resource. What is the risk?
terraform apply --target bypasses dependency checking. It can create inconsistencies between resources and is generally a last resort.
6 / 15
During a code review of a Terraform configuration for our new Kubernetes cluster deployment, Sarah points out that the terraform plan output shows a significant change in the number of worker nodes compared to the original state. She asks, 'What does it mean when we see this drift detected by terraform plan?'
Terraform drift occurs when the actual state of your infrastructure deviates from what's defined in your Terraform configuration. The terraform plan highlights these differences by showing changes that would be made to bring the infrastructure back into alignment with the desired state. This is a critical warning sign, indicating external modifications have impacted the cluster.
7 / 15
In a Slack channel for the Infrastructure team, Mark writes: 'Just ran `terraform apply` on the staging environment and it's showing significant drift. We need to investigate why our database size changed from 10GB to 50GB.' What is the primary cause of this message?
Mark's message directly points to a core issue with IaC drift: changes made *outside* of Terraform are the most common cause. Terraform relies on its state file to represent the infrastructure; any modifications not tracked by Terraform will lead to discrepancies and drift detection. Transient network issues or automatic scaling, while possible, are less likely explanations for such a drastic change.
8 / 15
During a standup meeting, David reports: 'We're seeing increasing instances of drift in our production environment. Specifically, the number of web servers has grown by 20% over the last week.' What is the *most* important action to take immediately following this report?
The first step when detecting drift is always to understand *what* changed. A terraform plan will reveal precisely what actions Terraform would take to reconcile the current state with the desired configuration. This allows you to pinpoint the root cause of the drift and assess the impact.
9 / 15
You're reviewing a PR that adds a new feature to our infrastructure as code. The PR includes a comment: 'I've added a state locking mechanism to prevent concurrent modifications during the deployment.' What is the *primary* benefit of using state locking?
State locking is a critical mechanism for maintaining consistency in Terraform workflows. By restricting concurrent access to the state file, it prevents race conditions and ensures that updates are applied atomically – either all changes are successful or none are, avoiding corrupted state and unpredictable infrastructure behavior.
10 / 15
A senior engineer, Emily, asks you to investigate a drift issue with our CI/CD pipeline. She suggests using targeted applies with the --target flag to remediate drift on a specific resource – a particular Kubernetes deployment. What is the *primary* risk associated with this approach?
While targeted applies can be useful in specific scenarios, they introduce complexity and potential risks. Applying changes to individual resources without considering their dependencies or interactions can easily lead to inconsistencies and unexpected behavior across the infrastructure. It's generally best practice to use more comprehensive approaches for drift remediation.
11 / 15
During a code review of a Terraform configuration for our new Kubernetes cluster deployment, Sarah points out that the terraform plan output shows a significant change in the number of worker nodes compared to the original state. She asks, 'What does it mean when we see this drift detected by terraform plan?'
Terraform drift occurs when the actual state of your infrastructure deviates from what's defined in your Terraform configuration. The terraform plan highlights these differences by showing changes that would be made to bring the infrastructure back into alignment with the desired state. This is a critical warning sign, indicating external modifications have impacted the cluster.
12 / 15
In a Slack channel for the Infrastructure team, Mark writes: 'Just ran `terraform apply` on the staging environment and it's showing significant drift. We need to investigate why our database size changed from 10GB to 50GB.' What is the primary cause of this message?
Mark's message directly points to a core issue with IaC drift: changes made *outside* of Terraform are the most common cause. Terraform relies on its state file to represent the infrastructure; any modifications not tracked by Terraform will lead to discrepancies and drift detection. Transient network issues or automatic scaling, while possible, are less likely explanations for such a drastic change.
13 / 15
During a standup meeting, David reports: 'We're seeing increasing instances of drift in our production environment. Specifically, the number of web servers has grown by 20% over the last week.' What is the *most* important action to take immediately following this report?
The first step when detecting drift is always to understand *what* changed. A terraform plan will reveal precisely what actions Terraform would take to reconcile the current state with the desired configuration. This allows you to pinpoint the root cause of the drift and assess the impact.
14 / 15
You're reviewing a PR that adds a new feature to our infrastructure as code. The PR includes a comment: 'I've added a state locking mechanism to prevent concurrent modifications during the deployment.' What is the *primary* benefit of using state locking?
State locking is a critical mechanism for maintaining consistency in Terraform workflows. By restricting concurrent access to the state file, it prevents race conditions and ensures that updates are applied atomically – either all changes are successful or none are, avoiding corrupted state and unpredictable infrastructure behavior.
15 / 15
A senior engineer, Emily, asks you to investigate a drift issue with our CI/CD pipeline. She suggests using targeted applies with the --target flag to remediate drift on a specific resource – a particular Kubernetes deployment. What is the *primary* risk associated with this approach?
While targeted applies can be useful in specific scenarios, they introduce complexity and potential risks. Applying changes to individual resources without considering their dependencies or interactions can easily lead to inconsistencies and unexpected behavior across the infrastructure. It's generally best practice to use more comprehensive approaches for drift remediation.
What will I practise in "IaC Drift Detection and Remediation Language"?
Practice the vocabulary for discussing infrastructure drift, state management, and remediation in English.
How many exercises are in this module?
This module has 15 multiple-choice exercises, each with instant feedback and a full explanation of the correct answer.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall.
Do I need to create an account to do these exercises?
No account is required. Just click an option to answer — your score for this session is tracked automatically in the progress bar above.
What happens if I choose the wrong answer?
You'll immediately see which answer was correct, plus a full explanation covering the vocabulary and reasoning behind it — mistakes are where most of the learning happens.
Can I retry the exercises if I want a higher score?
Yes — use the "Try again" button on the results screen to reset and go through all the questions again.
Is my progress saved if I close the page?
No. Progress is tracked only for your current visit; reloading or leaving the page resets the counter. This keeps the exercise simple and account-free.
Where can I find more Infrastructure as Code (IaC) exercises?
Browse the full Infrastructure as Code (IaC) hub for related drills, or check the "Next up" link below to continue with a connected topic.
How is this different from reading an article on the same topic?
Articles explain vocabulary and concepts in prose; this exercise tests and reinforces that vocabulary through active recall with immediate feedback — the two work best together.
Who writes these exercises?
Every exercise is written by the CoderSlingo team, drawing on real workplace English used in IT roles, then reviewed for accuracy and clarity.