Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Question 42 of 108
Free Preview · 108 of 359 · questions 1–108 of 359 are free. Sign up free to sync your progress across devices.
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
C. Grant the [email protected] service account the roles/storage.objectCreator role for the Cloud Storage bucket. The error "403 Forbidden" typically indicates a permissions issue. When a Google Cloud Function tries to access a resource in another project (in this case, a Cloud Storage bucket in project B), it does so using its associated service account. By default, this service account is [email protected] where PROJECT_ID is the ID of the project where the Cloud Function is running (project A).
Correct : C
C. Grant the [email protected] service account the roles/storage.objectCreator role for the Cloud Storage bucket. In order for the Cloud Functions code running in project A to write to a Cloud Storage bucket in project B, the service account that is used to execute the code needs to be granted the appropriate permissions. In this case, you should grant the [email protected] service account the roles/storage.objectCreator role for the Cloud Storage bucket in project B. This will allow the code to write objects to the bucket. Option A would not work because it is the service account, not your user account, that needs to be granted permissions.