Google Professional Cloud DevOps Engineer Question 37
Select 3Google Cloud PlatformYour team is adopting ephemeral environments for testing purposes in a CI/CD pipeline. These environments need to be dynamically created and destroyed on Google Cloud, ensuring cost efficiency and consistency across deployments. Which of the following are best practices to manage ephemeral environments effectively?
- A
Use Infrastructure as Code (IaC) tools like Terraform or Deployment Manager to define and manage the environments.
- B
Manually configure each environment to ensure it meets specific testing requirements.
- C
Implement automated cleanup scripts or TTL (Time-To-Live) policies to ensure environments are destroyed after use.
- D
Use shared, long-running environments to reduce the overhead of constantly creating and destroying resources.
- E
Leverage unique naming conventions for resources to avoid conflicts and simplify tracking.
Show answer and explanation
Correct answers: A, C, E
Explanation
Managing ephemeral environments effectively requires automation, cost control, and resource isolation. By using IaC tools, you can ensure consistent and repeatable environment creation. Automated cleanup scripts or TTL policies help control costs by ensuring environments are destroyed after use. Unique naming conventions simplify resource tracking and prevent conflicts. Avoid manual configuration or shared, long-running environments as they contradict the principles of ephemeral environments and DevOps best practices.
- A. Correct.
Correct. Using IaC tools allows you to define environments declaratively, ensuring consistency, repeatability, and ease of deployment.
- B. Incorrect.
Incorrect. Manually configuring environments is error-prone, time-consuming, and does not align with DevOps best practices for automation and scalability.
- C. Correct.
Correct. Automated cleanup or TTL policies prevent resource sprawl and ensure cost efficiency by removing unused environments.
- D. Incorrect.
Incorrect. Shared, long-running environments contradict the concept of ephemeral environments, which are meant to be short-lived and isolated.
- E. Correct.
Correct. Unique naming conventions help avoid resource conflicts and make it easier to track and manage ephemeral environments.