Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 343 of 481

Professional Cloud Developer. Professional level, Google Cloud. Free question with the correct answer and a full explanation.

Google Professional Cloud Developer Question 343

Select 3Google Cloud Platform

You are developing a backend system on Google Cloud and need to process uploaded images in real-time. The images are uploaded to a Cloud Storage bucket, and you want to invoke a function to process the images whenever a new file is uploaded. Which of the following steps are required to achieve this?

  1. A

    Create a Cloud Function with a Cloud Storage trigger and specify the bucket name.

  2. B

    Set the Cloud Function to be triggered by the 'google.storage.object.finalize' event.

  3. C

    Manually poll the bucket for new files using a custom script and invoke the Cloud Function using an HTTP trigger.

  4. D

    Enable the Cloud Storage API and grant the required permissions to the Cloud Function's service account.

  5. E

    Use Pub/Sub to subscribe to bucket notifications and invoke the Cloud Function when a new message is received.

Show answer and explanation

Correct answers: A, B, D

Explanation

To process new files uploaded to a Cloud Storage bucket, you can use a Cloud Function with a Cloud Storage trigger. This approach removes the need for manual polling or intermediate Pub/Sub configurations. The trigger should be set to respond to the 'google.storage.object.finalize' event, which is fired when a new object is successfully created. Additionally, proper permissions need to be set up for the Cloud Function's service account to access the bucket.

  • A. Correct.

    Correct. To automatically invoke a Cloud Function when a file is uploaded, you need to create a Cloud Function with a Cloud Storage trigger and specify the bucket name.

  • B. Correct.

    Correct. The 'google.storage.object.finalize' event is triggered when a new object is successfully created in the bucket, which is the appropriate event for processing new uploads.

  • C. Incorrect.

    Incorrect. Manually polling for new files is not an efficient or recommended solution in this scenario when Cloud Storage triggers are available.

  • D. Correct.

    Correct. The Cloud Storage API must be enabled, and the Cloud Function's service account needs the appropriate permissions (e.g., 'roles/storage.objectViewer') to access the bucket and its contents.

  • E. Incorrect.

    Incorrect. While Pub/Sub can be used for bucket notifications, it is not required in this case since Cloud Functions can directly subscribe to Cloud Storage events.

Timed practice exam

Take a Google Professional Cloud Developer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam