ASSOCIATE-CLOUD-ENGINEER · Question #319
ASSOCIATE-CLOUD-ENGINEER Question #319: Real Exam Question with Answer & Explanation
The correct answer is D: Create a Cloud Function triggered by Cloud Storage bucket events to submit the file URI to the. To automatically extract text from audio files in Cloud Storage using the Speech-to-Text API, implement a Cloud Function triggered by Cloud Storage bucket events to process each file as it arrives, providing a fully managed, serverless, and authenticated solution.
Question
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?
Options
- ACreate an App Engine standard environment triggered by Cloud Storage bucket events to submit
- BRun a Kubernetes job to scan the bucket regularly for incoming files, and call the Speech-to-Text
- CRun a Python script by using a Linux cron job in Compute Engine to scan the bucket regularly for
- DCreate a Cloud Function triggered by Cloud Storage bucket events to submit the file URI to the
Explanation
To automatically extract text from audio files in Cloud Storage using the Speech-to-Text API, implement a Cloud Function triggered by Cloud Storage bucket events to process each file as it arrives, providing a fully managed, serverless, and authenticated solution.
Common mistakes.
- A. While App Engine is serverless, setting up an App Engine service specifically for an event-driven trigger for each file arrival is generally overkill and less direct than a Cloud Function. Cloud Functions are designed for single-purpose, event-driven tasks, making them a more efficient and recommended solution for this specific scenario.
- B. Running a Kubernetes job to scan regularly introduces management overhead (Kubernetes cluster, job scheduling) and isn't truly event-driven, as it relies on polling rather than immediate reaction to file uploads, also going against the fully managed and serverless preference.
- C. A Linux cron job on a Compute Engine instance is not a fully managed or serverless solution; it requires managing a VM, operating system, and the cron scheduler, and it relies on polling rather than event-driven execution, which is less efficient.
Concept tested. Event-driven serverless processing with Cloud Functions
Reference. https://cloud.google.com/functions/docs/calling/storage
Community Discussion
No community discussion yet for this question.