Google Cloud Associate Cloud Engineer — Question 241
You need to extract text from audio files by using the Speech-to-Text API. The audio files are pushed to a Cloud Storage bucket. You need to implement a fully managed, serverless compute solution that requires authentication and aligns with Google-recommended practices. You want to automate the call to the API by submitting each file to the API as the audio file arrives in the bucket. What should you do?
Answer options
- A. Create an App Engine standard environment triggered by Cloud Storage bucket events to submit the file URI to the Google Speech-to-TextAPI.
- B. Run a Kubernetes job to scan the bucket regularly for incoming files, and call the Speech-to-Text API for each unprocessed file.
- C. Run a Python script by using a Linux cron job in Compute Engine to scan the bucket regularly for incoming files, and call the Speech-to-Text API for each unprocessed file.
- D. Create a Cloud Function triggered by Cloud Storage bucket events to submit the file URI to the Google Speech-to-Text API.
Correct answer: D
Explanation
The correct answer is D because Cloud Functions provide a serverless solution that is triggered by Cloud Storage events, which perfectly fits the requirement for automation as files are uploaded. Option A is incorrect as App Engine is not fully serverless in the same way as Cloud Functions. Options B and C involve regular scanning and are not event-driven, making them less efficient and not in line with the serverless requirement.