Medium1 markMultiple Choice
Domain 3.3: Deploying and implementing Cloud Run and Cloud FunctionsCloud FunctionsCloud StorageEvent-DrivenServerless
GCP ACE · Question 26 · Domain 3.3: Deploying and implementing Cloud Run and Cloud Functions
You are writing a Python script that needs to execute automatically every time a new image is uploaded to a specific Cloud Storage bucket. The script will resize the image and save it to another bucket.
How should you deploy this script?
You are writing a Python script that needs to execute automatically every time a new image is uploaded to a specific Cloud Storage bucket. The script will resize the image and save it to another bucket.
How should you deploy this script?
Answer options:
A.
Deploy it on a Compute Engine VM and use a cron job to poll the bucket every minute.
B.
Deploy it as a Cloud Function triggered by Cloud Storage events.
C.
Deploy it to Cloud Run and configure an HTTP load balancer to route traffic from the bucket.
D.
Deploy it to App Engine and use Cloud Scheduler to trigger the script.
How to approach this question
Identify the GCP service best suited for lightweight, event-driven code execution.
Full Answer
B.Deploy it as a Cloud Function triggered by Cloud Storage events.✓ Correct
Cloud Functions is Google Cloud's event-driven serverless compute platform. It is designed to run single-purpose functions that are attached to events emitted from your cloud infrastructure and services. A file upload to Cloud Storage (Object Finalize event) is a native trigger for Cloud Functions.
Common mistakes
Choosing Compute Engine with polling. While it works, it is an anti-pattern in the cloud due to cost and inefficiency.
Practice the full GCP Associate Cloud Engineer Practice Exam 7
50 questions · hints · full answers · grading
More questions from this exam
Q01You are starting a new initiative and need to create a new Google Cloud project using the Cloud S...EasyQ02Your company is migrating to Google Cloud and wants to manage user identities centrally. They cur...MediumQ03You have just created a new Google Cloud project and want to deploy a containerized application u...MediumQ04Your finance team wants to perform complex SQL queries on your Google Cloud billing data to analy...MediumQ05You are managing a development project in Google Cloud. You want to ensure that you are notified ...Easy
Expert