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 DevOps team manages an enterprise application in Google Cloud and is implementing an automated CI pipeline using Cloud Build connected to an external Git repository. The pipeline must satisfy the following architectural requirements:
v1.2.3, but excluding pre-release tags like v1.2.3-alpha) are pushed.scan_id and severity_score) from the incoming JSON payload into build parameters.How should you configure Cloud Build to meet these requirements?
_SCAN_ID: ${body.scan_id} with Cloud KMS key wrapping, and configure a Cloud Source Repositories mirror to trigger builds using a commit_message: 'v*' filter.This option proposes using custom commit message filtering on a mirrored repository alongside a Webhook trigger that uses incorrect variable interpolation syntax ${body...} and Cloud KMS key wrapping.
$(body.path.to.field) rather than curly brace syntax ${body.path.to.field}.v1.0.0 would trigger builds even if no official release tag was created.$(body.property) syntax in Cloud Build triggers.The build was designed to trigger on Git commit comments and required custom envelope encryption via Cloud KMS in application code.
v*, create a Pub/Sub trigger that extracts parameters using SCAN_ID: $(body.scan_id) without underscores, and trigger the build via Cloud Scheduler.This configuration attempts to use a branch-based trigger for Git tags and creates a Pub/Sub trigger that defines custom substitution variables without leading underscores.
v* would incorrectly match pre-release tags like v1.0.0-alpha._). Defining SCAN_ID or SEVERITY_SCORE without a leading underscore causes Cloud Build to reject the trigger configuration during creation.refs/heads/*, ignoring refs/tags/*.The pipeline needed to listen to messages published by internal GCP microservices over Cloud Pub/Sub on specific branch pushes.
_SCAN_ID and _SEVERITY_SCORE, and deploy a Cloud Function that polls the external scanner API on a 5-minute schedule.This approach uses polling via a scheduled Cloud Function to detect scan completions and manually invoke a Cloud Build trigger using the Cloud Build REST API.
The external scanner did not support outbound webhooks and could only provide status updates through a pull/polling REST endpoint.
^v[0-9]+\.[0-9]+\.[0-9]+$, create a Webhook trigger authenticated with Secret Manager that maps _SCAN_ID: $(body.scan_id) and _SEVERITY_SCORE: $(body.severity_score), and reference the variables in the build configuration.This solution properly combines Cloud Build Push Tag triggers using RE2 regular expression filtering with Webhook triggers that leverage Secret Manager for authentication and dynamic JSON payload extraction into user-defined substitution variables.
^v[0-9]+\.[0-9]+\.[0-9]+$ matches standard semantic version tags (e.g., v1.0.0, v2.4.12) while strictly excluding pre-release suffixes (such as -alpha, -beta, or -rc1).$(body.path.to.field) to extract values directly from the incoming JSON body into build substitution variables._SCAN_ID and _SEVERITY_SCORE), whereas system-defined variables (such as $BRANCH_NAME or $TAG_NAME) do not use leading underscores.This configuration uses native Cloud Build trigger mechanisms without requiring intermediary compute layers (such as Cloud Functions or Cloud Run), providing a serverless, highly secure, and maintenance-free CI integration.
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