Google Professional Cloud DevOps Engineer exam dumps

Google Professional Cloud DevOps Engineer practice question 38 of 268

Professional Cloud DevOps Engineer. Associate level, Google Cloud. Free question with the correct answer and a full explanation.

Google Professional Cloud DevOps Engineer Question 38

Select 3Google Cloud Platform

Your team is using Google Cloud to create ephemeral environments for feature testing. These environments are spun up automatically when a new pull request is created and should be deleted after the pull request is merged or closed. However, you notice that some environments persist beyond their intended lifecycle, leading to increased costs. How can you ensure ephemeral environments are properly cleaned up after their lifecycle ends?

  1. A

    Use Pub/Sub to trigger a Cloud Function that deletes the environment when a pull request is closed.

  2. B

    Implement a naming convention for ephemeral resources and use a scheduled job to clean up resources matching the naming convention.

  3. C

    Use Terraform with a time-to-live (TTL) configuration to automatically destroy ephemeral resources after a set duration.

  4. D

    Rely on manual deletion by developers after pull requests are merged or closed.

  5. E

    Use Cloud Logging to monitor pull request events and trigger resource deletion as needed.

Show answer and explanation

Correct answers: A, B, C

Explanation

Ephemeral environments should be managed with automation to ensure they are provisioned and deleted as needed without manual intervention. Utilizing event-driven approaches like Pub/Sub with Cloud Functions, enforcing naming conventions for scheduled cleanup, and leveraging infrastructure-as-code tools such as Terraform with TTL configurations are all effective methods for managing ephemeral resources. Manual deletion and incomplete monitoring without action are not reliable solutions for efficient DevOps workflows.

  • A. Correct.

    Correct: Using Pub/Sub to trigger a Cloud Function upon pull request closure is an effective automated solution to clean up ephemeral environments based on events.

  • B. Correct.

    Correct: A naming convention for ephemeral resources combined with a scheduled cleanup job is a robust way to ensure unused resources are identified and deleted.

  • C. Correct.

    Correct: Terraform's TTL feature can be set up to destroy resources automatically after a defined time, which is suitable for ephemeral environments.

  • D. Incorrect.

    Incorrect: Manual deletion introduces human error and inefficiencies, making it unsuitable for managing ephemeral environments in DevOps workflows.

  • E. Incorrect.

    Incorrect: While Cloud Logging can monitor pull request events, it cannot directly trigger resource deletion without additional automation, making it an incomplete solution.

Timed practice exam

Take a Google Professional Cloud DevOps Engineer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam