Question

Difficulty: MediumAdvising Development and Operation Teams

A software development team is building a microservices-based event processing application on Google Cloud that relies heavily on Cloud Pub/Sub and Cloud Datastore. The team leads report high Google Cloud charges during early development iterations and security risks due to developers creating service account keys on their local workstations to authenticate against live Cloud resources during local testing. As a Cloud Architect advising the development and operations teams, which TWO actions should you recommend to establish a secure, cost-effective local development and integration testing workflow?

  1. Advise developers to run Cloud Pub/Sub and Datastore local emulators on their workstations for local unit and integration testing.Answer
  2. Configure local environment variables to point application client libraries to the local emulator endpoints instead of live Google Cloud API endpoints.Answer
  3. C
    Generate long-lived JSON service account keys with the Project Owner role and commit them into the shared Git repository for developer convenience.
  4. D
    Grant every developer the Editor role at the project level so they can dynamically provision cloud resources whenever tests run.
  5. E
    Grant developers the Service Account Admin role on the project to allow automated creation of temporary service accounts during local test execution.

Answer

The development and operations teams should be advised to run Cloud Pub/Sub and Cloud Datastore local emulators on developer workstations and configure local environment variables to direct client libraries to the emulator endpoints.
Recommending Google Cloud local emulators allows developers to perform fast, isolated integration testing locally on their workstations without incurring live cloud consumption charges or requiring service account keys. Redirecting Google Cloud client libraries via environment variables ensures that application code remains environment-agnostic without requiring code changes.

Step-by-Step Solution

1
Identify the causes of cloud costs and security vulnerabilities during local development
Connecting local dev environments to live cloud services generates resource consumption costs and requires managing long-lived IAM service account keys.
Direct cloud resource connection from local machines introduces security risks and unnecessary expenses.
2
Evaluate GCP emulator capability for local development workflows
Google Cloud provides local emulators (e.g., gcloud emulators pubsub, datastore) that simulate GCP service behaviors locally without network calls to GCP endpoints.
Emulators eliminate GCP resource usage costs and eliminate the need for GCP authentication credentials during local testing.
3
Configure environment variables for client library redirection
Setting environment variables (such as PUBSUB_EMULATOR_HOST) automatically redirects Google Cloud SDK client calls to local localhost ports.
Client libraries natively support emulator redirection variables, keeping application code clean and identical between dev and production environments.

Key Concept

Advising Development and Operation Teams on Local Emulators and Environment Workflows
Rate this question