A managed instance group’s shutdown script that deletes Redis entries is unreliable. You created a Cloud Function to remove entries reliably. What next step ensures the function runs whenever an instance is removed?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a Cloud Monitoring (Logging) sink that triggers the Cloud Function when an instance removal log entry appears in Cloud Logging..
Why this is the answer
To reliably trigger the Cloud Function when an instance is removed, a Cloud Monitoring (Logging) sink is the most effective solution. When a VM instance is removed from a managed instance group, Cloud Logging records this event. A Logging sink can be configured to filter for these specific log entries and then publish them to a Pub/Sub topic. This Pub/Sub topic can then directly trigger the Cloud Function. This decouples the function's execution from the instance's shutdown script, which is unreliable. Modifying the shutdown script to wait or restart is not reliable because shutdown scripts can be interrupted or fail. Publishing to Pub/Sub from the shutdown script still relies on the script's successful execution, which is the problem you're trying to solve.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed