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?

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