Google Professional Cloud DevOps Engineer Question 16
Single answerGoogle Cloud PlatformYour team is managing a production environment running on Google Cloud. You were recently tasked to implement Infrastructure-as-Code (IaC) for consistent and repeatable deployments. During a recent incident, you noticed that a manual change in the configuration caused the environment to become inconsistent with the defined IaC. What is the best approach to prevent this issue from occurring in the future?
- A
Enable resource versioning and use a CI/CD pipeline to enforce IaC configurations.
- B
Set up a monitoring alert to notify the team when manual changes are made.
- C
Implement deployment policies to restrict manual changes and enforce IaC templates.
- D
Use a backup solution to restore resources in case of configuration drift.
Show answer and explanation
Correct answer: C
Explanation
Configuration drift occurs when the actual state of your infrastructure deviates from the desired state defined in your IaC templates. To address this, you should enforce deployment policies that prevent unauthorized manual changes and ensure that all infrastructure updates are made through IaC. This approach ensures consistency and aligns with best practices for managing infrastructure in Google Cloud.
- A. Incorrect.
While enabling resource versioning and CI/CD pipelines is a good practice, it doesn’t directly prevent manual changes from drifting the environment. This option addresses part of the problem but doesn't enforce IaC.
- B. Incorrect.
Monitoring alerts can notify the team of manual changes, but they don't actively prevent the changes or align the infrastructure with the IaC configuration, which is the primary goal.
- C. Correct.
This is the correct answer. Deployment policies that restrict manual changes and enforce IaC templates ensure that all changes to infrastructure are made through version-controlled IaC, preventing configuration drift.
- D. Incorrect.
Backup solutions can restore resources in case of disasters but are not designed to prevent or manage configuration drift caused by manual changes.