Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 121 of 481

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

Google Professional Cloud Developer Question 121

Select 2Google Cloud Platform

A company is deploying a serverless application on Google Cloud that uses Cloud Functions to process user data and Cloud Storage to store the processed files. The operations team wants to ensure the principle of least privilege is applied. Which IAM roles should be assigned to the Cloud Function's service account to achieve this goal?

  1. A

    roles/storage.objectCreator

  2. B

    roles/storage.admin

  3. C

    roles/storage.objectViewer

  4. D

    roles/cloudfunctions.invoker

  5. E

    roles/storage.legacyBucketOwner

Show answer and explanation

Correct answers: A, C

Explanation

To adhere to the principle of least privilege, you should assign only the permissions necessary for the Cloud Function to perform its tasks. The roles/storage.objectCreator role allows the Cloud Function to write files to Cloud Storage, while the roles/storage.objectViewer role allows it to read files if needed. Avoid using overly permissive roles like roles/storage.admin and roles/storage.legacyBucketOwner.

  • A. Correct.

    Correct: The roles/storage.objectCreator role allows the Cloud Function to write files to Cloud Storage, which is necessary for the application's functionality.

  • B. Incorrect.

    Incorrect: The roles/storage.admin role provides full control over Cloud Storage, which violates the principle of least privilege.

  • C. Correct.

    Correct: The roles/storage.objectViewer role is necessary if the Cloud Function needs to read objects in the bucket.

  • D. Incorrect.

    Incorrect: The roles/cloudfunctions.invoker role is used to invoke Cloud Functions, which is unrelated to the Cloud Function's access to Cloud Storage.

  • E. Incorrect.

    Incorrect: The roles/storage.legacyBucketOwner role grants broad permissions over the bucket, which is excessive and violates the principle of least privilege.

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