
Ultimate access to all questions.
You have a Compute Engine managed instance group that dynamically scales by adding and removing Compute Engine instances based on the load on your application. Each instance in this group runs a shutdown script intended to clean up by removing REDIS database entries associated with that instance when it is terminated. However, you've noticed that many of these database entries remain uncleared, suggesting that the shutdown script isn't reliably executing. To address this, you decide to use a Cloud Function to handle the removal of the database entries. What should you do next to ensure that the database clean-up is performed reliably every time an instance is shut down?
A
Modify the shutdown script to wait for 30 seconds before triggering the Cloud Function.
B
Do not use the Cloud Function. Modify the shutdown script to restart if it has not completed in 30 seconds.
C
Set up a Cloud Monitoring sink that triggers the Cloud Function after an instance removal log message arrives in Cloud Logging.
D
Modify the shutdown script to wait for 30 seconds and then publish a message to a Pub/Sub queue.