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.
You are deploying a containerized application in an external cloud provider that must connect to an AlloyDB for PostgreSQL instance in Google Cloud. The external hosts use dynamic outbound IP addresses, and there is no Cloud VPN or Cloud Interconnect configured.
Your security team mandates the following requirements:
Which architecture should you implement?
5432 with sslmode=require using a downloaded service account JSON key file.In a direct connection, the application's PostgreSQL driver communicates straight to the AlloyDB instance's IP address on port 5432 without going through the AlloyDB Auth Proxy or an AlloyDB Language Connector.
sslmode=require), but they do not support client certificates or higher SSL modes (verify-ca and verify-full) needed for mutual TLS authentication.0.0.0.0/0.The workload ran inside the same Google Cloud VPC connecting over private IP with strict latency requirements where Auth Proxy overhead is unacceptable and mTLS client verification is not mandated.
Both AlloyDB and Cloud SQL documentation strongly recommend pairing public IP connectivity with either the Auth Proxy or Language Connectors rather than opening authorized external networks for direct connections.
gcloud auth login, and run the AlloyDB Auth Proxy on each external host with the --gcloud-auth flag to connect to the AlloyDB instance's default private IP address.Workforce Identity Federation enables human users (such as database administrators and developers) to authenticate to Google Cloud using an external enterprise identity provider (IdP) like Okta or Microsoft Active Directory without a Google Account. Running the Auth Proxy without --public-ip causes it to target the AlloyDB instance's private IP by default.
gcloud auth login with the --gcloud-auth flag is not recommended for automated production workloads; instead, Application Default Credentials (ADC) should automatically consume WIF credentials.gcloud auth login sessions are meant for developer workstations or Cloud Shell, not containerized production services.CLOUD_IAM_WORKFORCE_IDENTITY database users for human sign-ins rather than automated service account impersonation.Human administrators needed interactive database access via psql using corporate Okta credentials over an established Cloud VPN or Cloud Interconnect tunnel.
Understanding the distinction between Workforce Identity Federation (human users) and Workload Identity Federation (machine workloads) is critical when designing keyless authentication architectures across hybrid and multi-cloud environments.
roles/alloydb.client and roles/serviceusage.serviceUsageConsumer roles. Configure all external application instances to connect directly to that VM's external IP address on port 5432.This approach places a single centralized AlloyDB Auth Proxy process on an intermediary Compute Engine VM inside the Google Cloud VPC and routes all external client database traffic through that VM's public IP address.
5432 is unencrypted by the proxy, meaning plaintext database traffic and credentials traverse the public internet between the external hosts and the Compute Engine VM.5433.5432 on a bastion VM's external IP expands the attack surface and still requires firewall management for dynamic external IPs.The intermediary VM ran a SOCKS5 proxy (with the Auth Proxy still running locally on each external host) or a properly TLS-configured PostgreSQL connection pooler for low-cost prototyping—neither of which is specified here.
Google Cloud best practices explicitly advise against deploying the AlloyDB Auth Proxy or Cloud SQL Auth Proxy on a shared VM to serve multiple remote workloads; instead, run one proxy per host or pod sidecar.
roles/alloydb.client and roles/serviceusage.serviceUsageConsumer roles via Application Default Credentials (ADC). Run the AlloyDB Auth Proxy with the --public-ip flag co-located on each external workload host, and configure the application to connect to 127.0.0.1:5432.Workload Identity Federation (WIF) allows workloads running outside Google Cloud—such as on AWS, Azure, or on-premises servers—to exchange their native external credentials for short-lived Google Cloud OAuth 2.0 access tokens without exporting service account JSON keys. The AlloyDB Auth Proxy is a client-side connector that establishes an IAM-authorized, mTLS 1.3 encrypted tunnel (using a 256-bit AES cipher) to an AlloyDB instance on TCP port 5433.
443 to fetch ephemeral SSL certificates (valid for 24 hours and automatically refreshed) to establish an mTLS 1.3 tunnel.--public-ip flag instructs the proxy to connect over the instance's public IP using IAM and mTLS on port 5433, eliminating the need for IP allowlisting.127.0.0.1:5432 never leaves the machine.roles/alloydb.client and roles/serviceusage.serviceUsageConsumer isolates permissions per workload.localhost without code changes.Combining WIF with a co-located Auth Proxy is Google Cloud's recommended pattern for external workloads that lack private network connectivity, delivering zero-trust encryption and keyless IAM authorization without operational bottlenecks.
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