Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 122 of 481

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

Google Professional Cloud Developer Question 122

Single answerGoogle Cloud Platform

You are developing a serverless application on Google Cloud that uses Cloud Functions to process images and store metadata in Firestore. You need to ensure that the Cloud Function has the appropriate permissions to write to Firestore, but you also want to follow the principle of least privilege. Which IAM role should you assign to the Cloud Function's service account?

  1. A

    Firestore Viewer

  2. B

    Firestore Editor

  3. C

    Cloud Functions Admin

  4. D

    Cloud Datastore User

Show answer and explanation

Correct answer: D

Explanation

The principle of least privilege dictates that you should only grant the minimal permissions required for a task. In this case, the Cloud Function needs to write metadata to Firestore, and the Cloud Datastore User role provides the necessary permissions without granting unnecessary access. Other roles either provide excessive permissions or lack the required permissions to write to Firestore.

  • A. Incorrect.

    The Firestore Viewer role only provides read access to Firestore, which is insufficient for writing metadata.

  • B. Incorrect.

    The Firestore Editor role provides both read and write access, but it grants broader permissions than required for this use case, violating the principle of least privilege.

  • C. Incorrect.

    The Cloud Functions Admin role allows managing Cloud Functions, but it does not provide access to Firestore.

  • D. Correct.

    The Cloud Datastore User role grants the necessary permissions to read and write Firestore documents, adhering to the principle of least privilege. (Firestore and Cloud Datastore share the same underlying technology.)

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