Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your team runs a payment microservice on Cloud Run that authenticates to an external third-party payment API using an API key stored in Secret Manager. The Google Cloud project contains secrets for multiple microservices. You must meet the following requirements:
Which configuration should you implement?
roles/secretmanager.viewer at the project level to the payment microservice, and configure the microservice to resolve the latest version on application startup.Parameter Manager is an extension to Secret Manager designed for storing and delivering diverse workload configuration data—such as feature flags, environment settings, and JSON or YAML configurations—at scale. Secret expiration is a lifecycle feature that automatically and permanently deletes secret data at a configured time.
SECRET_ROTATE Pub/Sub notifications.roles/secretmanager.viewer role grants permission only to view resource metadata (such as names and version lists), not to read secret payloads (secretmanager.versions.access). The payment microservice would be unable to retrieve the API key.latest on application startup causes cascading failures whenever Cloud Run scales up or restarts instances if a defective secret version was added.roles/secretmanager.viewer intentionally excludes payload access.Parameter Manager would be appropriate for storing non-sensitive application settings that reference separately rotated Secret Manager secrets, and expiration would be suitable for short-lived sandbox environments.
For time-limited access to production secrets without risking permanent data loss, use time-based IAM Conditions instead of secret expiration.
roles/secretmanager.secretVersionManager at the secret level. Grant roles/secretmanager.secretAccessor to the payment microservice's service account directly on that secret, pin the deployment configuration to a specific secret version number, and disable old versions before destroying them.Secret Manager provides centralized storage, encryption, and lifecycle management for sensitive credentials such as API keys. Using automated rotation schedules integrated with Pub/Sub event notifications, Secret Manager decouples credential renewal from application code, while secret versioning and secret-level IAM bindings enforce controlled rollouts and least-privilege access.
SECRET_ROTATE notification every 30 days. A dedicated Cloud Run service receives the message, generates a new key via the external API, and adds a new secret version.roles/secretmanager.secretVersionManager scoped to the payment secret allows the rotation job to add, disable, and destroy versions without reading secret payloads or accessing other secrets. Granting roles/secretmanager.secretAccessor at the secret resource level restricts the payment microservice to reading only its own API key.secretAccessor) from version lifecycle management (secretVersionManager).Unlike polling latest, storing secrets in environment variables, or relying on Parameter Manager, this architecture combines native rotation triggers, deterministic release-based rollouts, and strict resource-level IAM isolation.
roles/secretmanager.secretAccessor at the project level to the payment microservice, configure the microservice to poll the latest alias continuously at runtime, and immediately destroy previous secret versions once a new version is added.Continuous polling of the latest alias queries Secret Manager repeatedly at runtime so applications adopt new credentials immediately without redeployment, while project-level IAM bindings and the default Cloud Run service account apply broad permissions across resources in a project.
latest alias pushes newly rotated keys to all running instances at once. If the rotation workflow stores an invalid or unactivated API key, it causes an immediate, service-wide outage without gradual validation or release-pipeline rollback.roles/secretmanager.secretAccessor at the project level allows the payment microservice to read every secret in the project. Additionally, the default Cloud Run service account carries the overly permissive Editor role (roles/editor), expanding the blast radius if compromised.latest impact live production traffic instantly with no canary or release-gate control.This approach might be acceptable only in an isolated, single-service development environment where instant credential propagation is prioritized over availability and strict secret isolation.
A production-ready rotation workflow replaces the default service account with a dedicated service account, scopes IAM roles to individual secrets, pins explicit version numbers in deployment configurations, and disables old versions before destroying them.
Cloud SQL DB credentials secret type with a 30-day rotation schedule so Secret Manager handles rotation natively without Pub/Sub. Inject the latest secret alias into the payment microservice as a Cloud Run environment variable, and grant roles/secretmanager.admin at the project level to the deployment pipeline.The Cloud SQL DB credentials secret type provides built-in automatic rotation for regional secrets linked to Cloud SQL databases, generating and updating database passwords natively. Environment variable injection exposes secret values directly to an application's process environment rather than retrieving them through the Secret Manager API.
Cloud SQL DB credentials only supports regional secrets targeting compatible Cloud SQL database engines (such as PostgreSQL or SQL Server). It cannot rotate credentials for an external third-party payment API.roles/secretmanager.admin at the project level provides full administrative access—including reading payloads and altering IAM policies—across all secrets in the project. Referencing latest also prevents controlled rollbacks.Cloud SQL DB credentials type can only be selected at secret creation, requires a regional secret in the database's region, and prohibits manual version additions.roles/secretmanager.admin combines payload access, lifecycle control, and IAM policy management.The Cloud SQL DB credentials secret type would be the right choice if the application needed to rotate PostgreSQL or SQL Server credentials on a regional Cloud SQL instance rather than third-party API keys.
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