Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud DevOps Engineer practice bank has 1,455 more like it. Try 10 free: instant score, no account.
Your enterprise DevOps team is establishing an automated CI/CD pipeline in Google Cloud Build to produce secure, immutable golden VM images for Compute Engine workloads using HashiCorp Packer.
The pipeline must satisfy the following architectural and security requirements:
Which configuration and IAM permission setup should you implement?
Automating golden machine image creation with HashiCorp Packer inside Google Cloud Build enables declarative, reproducible, and immutable VM image lifecycles. Cloud Build executes containerized build steps, using a prebuilt Packer builder container image stored in Artifact Registry or Container Registry to provision temporary instances, install hardened dependencies, and package the resulting disk into a Compute Engine image.
roles/compute.instanceAdmin.v1) role provides the necessary permissions to create, run, and delete temporary VM build instances and register machine images, without granting overly permissive roles like roles/editor or roles/owner.packer build inside the execution container, passing necessary project, zone, and template parameters directly through cloudbuild.yaml.image_family parameter ensures that downstream deployment tooling (like Terraform, MIG templates, or deployment scripts) can always query and reference the newest active image in the family.This solution implements Google Cloud best practices for image baking by leveraging containerized build steps and scoped predefined IAM roles. It eliminates manual intervention and prevents broad administrative privilege escalation across the cloud environment.
This setup attempts to host a self-managed Jenkins server on Compute Engine configured with full access scopes and uses kpt to convert Kubernetes YAML manifests directly into virtual machine disk images.
cloud-platform scopes combined with uncurated server access creates excessive privileges and violates least privilege isolation.kpt operates on Kubernetes resource configurations, packages, and custom functions, not hypervisor/OS-level VM disk partitions.The requirement were focused entirely on packaging, customizing, and validating declarative Kubernetes manifests across GKE clusters rather than baking Compute Engine VM images.
This configuration grants the Compute Image User role to Cloud Build and relies on runtime startup scripts to install application dependencies and configurations on running VMs rather than pre-baking an immutable image.
roles/compute.imageUser role only permits reading and using existing images to launch instances; it lacks the necessary permissions to create disks, manage instances, or create new Compute Engine images during the Packer build workflow.roles/compute.imageUser is intended for consumer projects that instantiate VMs from a shared image project, not for image builder pipelines.This pattern would be appropriate for dynamic, per-instance customization where identical pre-baked images are not suitable and where VMs are launched from a central shared image library.
This approach attempts to build machine images by dynamically downloading and installing the Packer binary during pipeline execution and granting the broad Project Editor role to the default Compute Engine service account.
roles/editor grants extensive read, write, and delete permissions across nearly all Google Cloud resources in the project, directly violating organizational security baselines and least privilege recommendations.iam.automaticIamGrantsForDefaultServiceAccounts).This approach would only be acceptable in a temporary sandbox or proof-of-concept environment with no compliance or security requirements and where prebuilt container images are unavailable.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated