A DevOps engineer is troubleshooting a Cloud Build failure. The build log shows the error: 'Permission denied for resource projects/my-project/locations/us-central1/repositories/my-repo'. The Cloud Build service account (PROJECT_NUMBER@cloudbuild.gserviceaccount.com) is used. What is the most likely missing role?
Trap 1: roles/artifactregistry.reader
This role allows reading artifacts but not writing, so it would cause permission denied when trying to push.
Trap 2: roles/artifactregistry.admin
This role provides full administrative access, including write, but it is overly permissive; the principle of least privilege suggests writer is sufficient.
Trap 3: roles/cloudbuild.builds.builder
This role is for Cloud Build itself, not for accessing Artifact Registry; it does not grant repository permissions.
- A
roles/artifactregistry.reader
Why wrong: This role allows reading artifacts but not writing, so it would cause permission denied when trying to push.
- B
roles/artifactregistry.admin
Why wrong: This role provides full administrative access, including write, but it is overly permissive; the principle of least privilege suggests writer is sufficient.
- C
roles/cloudbuild.builds.builder
Why wrong: This role is for Cloud Build itself, not for accessing Artifact Registry; it does not grant repository permissions.
- D
roles/artifactregistry.writer
This role grants write access to the repository, which is required to push build artifacts, resolving the permission denied error.