Google Cloud Professional Cloud DevOps Engineer — Question 6
You use a multiple step Cloud Build pipeline to build and deploy your application to Google Kubernetes Engine (GKE). You want to integrate with a third-party monitoring platform by performing a HTTP POST of the build information to a webhook. You want to minimize the development effort. What should you do?
Answer options
- A. Add logic to each Cloud Build step to HTTP POST the build information to a webhook.
- B. Add a new step at the end of the pipeline in Cloud Build to HTTP POST the build information to a webhook.
- C. Use Stackdriver Logging to create a logs-based metric from the Cloud Build logs. Create an Alert with a Webhook notification type.
- D. Create a Cloud Pub/Sub push subscription to the Cloud Build cloud-builds PubSub topic to HTTP POST the build information to a webhook.
Correct answer: D
Explanation
The correct answer is D because creating a Cloud Pub/Sub push subscription allows automatic forwarding of build information to a webhook without modifying individual build steps, thereby minimizing development effort. Option A requires repetitive logic in every build step, which increases complexity. Option B, while simpler than A, still involves adding steps, and option C does not directly send build information to the webhook as effectively as option D.