Google Cloud Professional Cloud Developer — Question 235

You have two Google Cloud projects, named Project A and Project B. You need to create a Cloud Function in Project A that saves the output in a Cloud Storage bucket in Project B. You want to follow the principle of least privilege. What should you do?

Answer options

Correct answer: B

Explanation

The correct answer is B because it involves creating a service account in the same project where the Cloud Function is deployed (Project A) and granting it the necessary permissions to the storage bucket in Project B. Options A, C, and D do not adhere to the least privilege principle or misconfigure the service accounts across the projects.