Question-29: You are now employed by a government-run bank in India, which just very recently contracted the services of a consulting firm in order to implement a cloud banking system. You have a Compute Engine managed instance group that monitors the load on your application and adds or removes Compute Engine instances as necessary from the group. A shutdown script is included with the instances, and it is responsible for removing any REDIS database records that are related with the instance. You discover that a significant number of database records were not erased, and you have a sneaking suspicion that the shutdown routine is to blame. You have an obligation to guarantee that the instructions included in the shutdown script are executed in a dependable manner each time an instance is terminated. You do this by developing a Cloud Function that can clear out the database entries. What steps should you take after this?
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.
Correct Answer
Get All 340 Questions and Answer for Google Professional Cloud Architect
: 3 Explanation: Sink is not capable of directly triggering a cloud function. It is necessary to use Pub/Sub, which will then activate Cloud Function. owing to the fact that the shutdown script is executed based on our best efforts, which is not a reliable method. Compute Engine will only make a best-effort attempt to run shutdown scripts when necessary. Compute Engine cannot always guarantee that the shutdown script will finish running successfully, especially in unusual circumstances. Even though the Cloud Monitoring sink cannot directly trigger a cloud function at this time, it is possible to do so through the use of Pub/Sub. Install a Cloud Monitoring sink that, when triggered, will send a message to the Cloud Function whenever an instance removal log message is received by Cloud Logging.