Easy1 markMultiple Choice

GCP ACE · Question 25 · Domain 3.3: Deploying and implementing Cloud Run and Cloud Functions

You are writing a Cloud Function in Node.js that needs to execute every time a new file is uploaded to a specific Cloud Storage bucket.

How should you configure the trigger for this Cloud Function?

Answer options:

A.

Configure an HTTP trigger and configure Cloud Storage to send a webhook.

B.

Configure a Cloud Storage trigger using the 'google.storage.object.finalize' event.

C.

Configure a Pub/Sub trigger and poll the bucket every minute.

D.

Configure a Cloud Storage trigger using the 'google.storage.object.create' event.

How to approach this question

Know the specific event names used by Cloud Storage to trigger Cloud Functions.

Full Answer

B.Configure a Cloud Storage trigger using the 'google.storage.object.finalize' event.✓ Correct
Configure a Cloud Storage trigger using the 'google.storage.object.finalize' event.
Cloud Functions can be natively triggered by Cloud Storage events. The specific event type that fires when a file is newly uploaded or overwritten is `google.storage.object.finalize`.

Common mistakes

Choosing 'create' instead of 'finalize', as 'finalize' is the specific GCP terminology.

Practice the full GCP Associate Cloud Engineer Practice Exam 2

50 questions · hints · full answers · grading

More questions from this exam