Courseiva

Google PCA Practice Question: Managing and Provisioning a Solution Infrastructure

An engineer is troubleshooting a Cloud Build trigger that fails with the error 'PERMISSION_DENIED: Cloud Build service account does not have permission to access Artifact Registry'. The build needs to push a Docker image to Artifact Registry. What is the correct IAM role to assign to the Cloud Build service account?

⚠ Common exam trap

The trap is assuming that a broad role like roles/editor or a storage-related role will cover Artifact Registry access — the exam expects you to know the service-specific predefined roles and to apply least privilege.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

roles/artifactregistry.writer

Cloud Build's service account needs to push images to Artifact Registry, which requires write access to repositories. The predefined role roles/artifactregistry.writer grants exactly the permissions needed to upload and delete artifacts (including Docker image push) within Artifact Registry repositories. Assigning this role to the Cloud Build service account resolves the PERMISSION_DENIED error while following least privilege.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    roles/artifactregistry.writer

    Why this is correct

    Granting roles/artifactregistry.writer provides the write permissions Cloud Build requires to push Docker images into Artifact Registry, satisfying the PERMISSION_DENIED constraint. This role permits uploading and creating repository content without granting broader administrative capabilities, so the build service account can complete its image push securely.

  • ✗

    roles/artifactregistry.viewer

    Why it's wrong here

    roles/artifactregistry.viewer grants only read access, so the build cannot push the Docker image and still fails. It is tempting because viewer is the minimal role for pulling images, and would be correct if the pipeline only needed to download artefacts rather than write them.

  • ✗

    roles/editor

    Why it's wrong here

    roles/editor grants broad project-wide write access, not the granular Artifact Registry repository permissions Cloud Build needs to push images. It is tempting because Editor historically covered many build tasks, but it violates least privilege and lacks the specific artifactregistry.writer role required for this push.

  • ✗

    roles/storage.objectAdmin

    Why it's wrong here

    roles/storage.objectAdmin governs Cloud Storage objects, not Artifact Registry repositories, so the push still fails. It is tempting because the name suggests broad storage write access, and it would be correct for writing build artefacts to a GCS bucket.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

This PCA question is part of Courseiva's 807-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Google Cloud exam blueprint

This PCA practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCA exam.