Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 346 of 481

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

Google Professional Cloud Developer Question 346

Select 3Google Cloud Platform

You are developing a Google Cloud Function to process user-uploaded images. The function should automatically execute whenever a new file is uploaded to a specific Cloud Storage bucket. Which of the following steps are required to properly configure the trigger for this functionality?

  1. A

    Set the trigger type to 'Cloud Storage' and configure the bucket name.

  2. B

    Set the trigger event to 'google.storage.object.finalize'.

  3. C

    Set the trigger type to 'Pub/Sub' and subscribe to the Cloud Storage bucket's topic.

  4. D

    Deploy the function with the '--trigger-bucket' flag specifying the bucket name.

  5. E

    Set the trigger event to 'google.storage.object.delete'.

Show answer and explanation

Correct answers: A, B, D

Explanation

To trigger a Google Cloud Function when a file is uploaded to a Cloud Storage bucket, you need to set the correct trigger type ('Cloud Storage'), specify the event type ('google.storage.object.finalize'), and deploy the function with the '--trigger-bucket' flag to associate it with the correct bucket. Other configurations, such as Pub/Sub or unrelated events, are not necessary for this specific scenario.

  • A. Correct.

    Correct. To invoke a Cloud Function when a file is uploaded, you must set the trigger type to 'Cloud Storage' and specify the bucket to monitor.

  • B. Correct.

    Correct. 'google.storage.object.finalize' is the event that triggers the function when a new or updated object is finalized in the bucket.

  • C. Incorrect.

    Incorrect. While Pub/Sub can be used with Cloud Storage, it is not necessary for this use case. You can directly configure the Cloud Function to listen to Cloud Storage events.

  • D. Correct.

    Correct. The '--trigger-bucket' flag is required during deployment to specify the bucket name for the trigger configuration.

  • E. Incorrect.

    Incorrect. 'google.storage.object.delete' is triggered when a file is deleted, not uploaded. This does not fulfill the requirements of the scenario.

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