Prepare and test your skills
Prepare and test your skills
Cloud Shell (opens in a new tab) is a browser-based shell and editor environment for managing, developing, and deploying cloud-native applications without local setup. Cloud Shell Editor (opens in a new tab) includes Cloud Code (opens in a new tab) by default, and the Cloud Shell terminal starts with the Google Cloud CLI already installed and authenticated to the current project.
Cloud Shell persistence is the rule that separates what survives a session from what is discarded. Cloud Shell runs on a temporary virtual machine (VM) that terminates after 40 minutes of inactivity, and the session can disconnect after about 20 minutes of inactivity. Only files under $HOME flow to a free 5 GB per-user persistent disk that is shared across projects, while any change outside $HOME stays on the ephemeral VM disk and is lost on termination. Starting a new session provisions a fresh VM and reattaches the existing home directory, so scripts, installed tools in $HOME, and files like .bashrc survive while system state resets.
The home disk behavior defines two modes and a reset path. Default persistent mode keeps $HOME files between sessions but takes up to 25 seconds on first connect, while ephemeral mode connects faster but loses all session files on exit. A no space left on device error means the 5 GB limit is full, which can be checked with du -hs $(ls -A) before deleting files. Resetting to defaults requires inspecting $HOME, running sudo rm -rf $HOME, then choosing Restart from the Cloud Shell menu to provision a new VM.
Exam tip: Files inside $HOME persist between sessions, while any modification outside $HOME is lost when the VM terminates after 40 minutes of inactivity.
Secure connectivity from Cloud Shell is an authenticated tunnel that reaches a private virtual machine (VM) without giving that VM a public address. Traffic flows from the Cloud Shell client through Identity-Aware Proxy (IAP) to the internal IP address of the destination VM, so IAP sits in the middle as the identity and trust boundary. The one-step command gcloud compute ssh VM-NAME --tunnel-through-iap creates both the tunnel and the SSH session, and this path is chosen when the target has only an internal IP address.
Reusable access extends the same IAP path to local tools such as VS Code and OpenSSH. Setup follows an ordered workflow: first generate and propagate keys with gcloud compute ssh --tunnel-through-iap and verify the connection, then open the local SSH config file, then append a Host block whose ProxyCommand runs gcloud compute start-iap-tunnel, then connect with ssh VM_NAME so traffic flows from the local client through IAP to the VM. The host entry must name the VM name, private key path, project ID, zone, and username.
Cloud-native development with Cloud Code is the in-editor workflow for building container images and deploying them to Google Kubernetes Engine (GKE) or Cloud Run. Cloud Code works in Cloud Shell Editor, Visual Studio Code, and supported JetBrains IDEs, and it supports Go, Java, Node.js, Python, and .NET Core with sample apps, snippets, and completions. Cloud Code builds source into an image, pushes that image to a registry such as Artifact Registry, and then traffic flows from the registry image to the running workload.
| Target | Build and run model | Observe and access |
|---|---|---|
| GKE application | Skaffold builds image and deploys Deployment and Service to a Kubernetes context | Kubernetes view shows Namespaces, Services, and External IPs |
| Cloud Run service | Cloud Code builds image and deploys revision, or runs locally in emulator | Cloud Run Explorer shows progress and Log Viewer shows logs |
GKE development starts from a template that includes app code, Deployment and Service YAML, and skaffold.yaml, created through Cloud Code: New Application in order by type, language, and location. Kubernetes YAML editing adds validation, snippets, and completions, while Run on Kubernetes enables watch mode where saved changes trigger automatic rebuild and redeploy. Cloud Run development adds local debugging in the built-in emulator, and production changes should use automated continuous integration and continuous delivery (CI/CD) rather than editor deploy.
Continue with this study guide: Cloud Shell Editor, Cloud Code, and Cloud Shell Terminal
The Google Cloud CLI (opens in a new tab) is the command-line toolchain for creating and automating Google Cloud resources, including gcloud for general administration, gcloud storage and gsutil for Cloud Storage, and bq for BigQuery. Configurations supply default project, account, region, and behavior to every command, while storage and BigQuery tools move data and run jobs without the console.
Storage command-line tools are the programs that create buckets and move objects using gs://BUCKET_NAME/OBJECT_NAME addresses. gcloud storage is the recommended tool inside the Google Cloud CLI with built-in parallel processing and support for current features, while gsutil is a legacy Python application that is minimally maintained and will no longer ship with the CLI after March 2027. At least one side of a gcloud storage transfer must be a Cloud Storage URI such as gs://my-bucket, so local-to-local copies are not allowed.
| Tool | Maintenance | Feature support | Performance tuning |
|---|---|---|---|
| gcloud storage | Recommended in Google Cloud CLI | Supports current features including hierarchical namespace buckets | Parallel processing applied automatically |
| gsutil | Legacy, minimally maintained | No support for soft delete or managed folders | Requires explicit -m flag for parallelism |
Behavioral differences matter for scripts. gcloud storage cp copies 0-byte console placeholder folders, continues with remaining sources when one source is invalid, and creates missing local destination directories, while gsutil cp does not. For very large file lists, gsutil reads one path or gs:// URL per line from standard input with -I, as in cat list.txt | gsutil -m cp -I gs://destination/. Access Control Lists (ACLs) grant per-bucket and per-object access and are managed with acl get, acl set, and acl ch in gsutil or describe and update in gcloud storage.
Core CLI configuration is a named collection of properties that controls which project and identity each command uses. A typical setup runs in order: first install or update with gcloud components update, then run gcloud init to sign in and pick defaults, then run gcloud config set project PROJECT_ID, then verify with gcloud config list and gcloud info. The active configuration supplies project and account to every invocation, so gcloud config configurations activate switches the full context while gcloud config set project changes only the project.
Authorization separates human and automated identities. User account authorization with gcloud init or gcloud auth login fits single-operator work, while service account authorization with gcloud auth activate-service-account --key-file [KEY_FILE] fits automation across machines and Compute Engine VMs shared by root users. Script-friendly output then flows from the API response through --filter to --format such as json, yaml, csv, or table, and prompts are suppressed with --quiet for one command or disable_prompts=True for a whole configuration.
Exam tip: Parallel execution of multiple gcloud CLI commands is not supported, so run automated gcloud calls sequentially.
BigQuery orchestration is the chaining of loading, transformation, and reporting steps so external events and scheduled jobs run in order with correct inputs. Event-driven scheduling starts work immediately when state changes, such as a file landing in Cloud Storage, while time-driven scheduling starts work on a clock, such as daily loads or hourly reports. Both methods can combine, for example by loading a data lake in real time but generating reports daily.
| Tool | Focus | Code type | User profile |
|---|---|---|---|
| Dataform | Data transformation | JavaScript, SQL, Python notebooks | Data analyst or administrator |
| Workflows | Microservices | YAML or JSON | Data architect |
| Managed Service for Apache Airflow | ETL or ELT | Python | Data engineer |
| Vertex AI Pipelines | Machine learning | Python | Data analyst |
Jobs can be submitted in the console, with bq query, with the jobs.query or jobs.insert REST methods, or with client libraries. Scheduled queries are the simplest option and support only straightforward, time-driven GoogleSQL chains with no external dependencies, including data definition language (DDL) for table structures and data manipulation language (DML) for rows. Choose Dataform, Workflows, Managed Airflow, or Vertex AI Pipelines when the workload combines services or runs parallel jobs.
Continue with this study guide: Google Cloud SDKs (e.g., gcloud, gsutil, and bq)
Local emulators are localhost simulations of Google Cloud services that let applications be tested without creating cloud resources or touching production data. The Google Cloud SDK provides emulators for Bigtable, Datastore in Firestore in Datastore mode, Firestore, Pub/Sub, and Spanner. Traffic flows from the application through the same Cloud Client Libraries (opens in a new tab) to either the local emulator endpoint or the production API endpoint, depending on environment configuration.
Emulator-based testing is the practice of starting a local service simulation inside development or continuous integration (CI) and running unit, integration, and end-to-end tests against it. The emulator runs on the developer machine or CI runner, so tests validate logic faster, save cost, and avoid production impact. Cloud Build can build from Cloud Storage, Cloud Source Repositories, GitHub, or Bitbucket into artifacts such as containers, Artifact Registry stores those packages and images, and Cloud Deploy promotes them through target environments in sequence.
Tool selection for pipeline integration depends on stack compatibility, degree of automation, CI/CD integration, and defect and test management. When the tool can start the emulator, run tests, and report results in the same workflow, every change is validated before promotion. Tests run first against the emulator, and only passing changes move forward to deployment.
Emulator limitations are the production controls that local simulation removes for identity, durability, security, and scale. The Bigtable emulator illustrates the pattern: it works with all Cloud Bigtable client libraries for creating tables and reading and writing data, but it provides no administrative APIs for instances and clusters, accepts any project and instance name, supports no secure connection, cannot be used in the HBase shell, and keeps all data only in memory with no persistence across runs. Restarting returns it to an empty state.
Because of these boundaries, a passing local test proves application logic but does not prove production readiness. Production Firestore and Datastore mode enforce access through service accounts and Identity and Access Management (IAM), while local emulators bypass that permission boundary. Local runs also do not validate durability, availability, throughput, global distribution, or messaging guarantees, so stateful behavior, failover, load, IAM roles, and secure connectivity must still be verified against live services.
Exam tip: The Bigtable emulator accepts any project and instance name and has no secure connection, so a working local test does not prove that production IAM permissions, instance names, or network security are configured correctly.
Environment redirection is the setup where the gcloud CLI starts a localhost emulator and an environment variable tells client libraries to use that endpoint instead of production. Each emulator has its own default: Bigtable defaults to localhost:8086, Pub/Sub defaults to port 8085, and Spanner uses localhost:9010 for gRPC and localhost:9020 for REST. Resources such as tables, topics, and subscriptions exist only for the emulator session lifetime.
| Emulator | Local endpoint | Environment variable to set |
|---|---|---|
| Bigtable emulator | localhost:8086 | BIGTABLE_EMULATOR_HOST=localhost:8086 |
| Pub/Sub emulator | Port 8085, for example [::1]:8085 | PUBSUB_EMULATOR_HOST and optional PUBSUB_PROJECT_ID |
| Spanner emulator | localhost:9010 for gRPC, localhost:9020 for REST | SPANNER_EMULATOR_HOST=localhost:9010 |
Install paths include gcloud components install pubsub-emulator for Pub/Sub and gcloud components install cloud-spanner-emulator for Spanner, while the first Bigtable start prompts to download its binary. Start commands support --host-port=HOST:PORT for custom binding and multiple emulators, and Docker images such as google/cloud-sdk can map the same ports for CI runners. Variables must be set on the application machine, with env-init helpers for Pub/Sub and Spanner, and Pub/Sub variables must be reset on restart because the port can change. Unset the variable after stopping so later calls return to production.
Continue with this study guide: Cloud Emulators (e.g., Bigtable, Spanner, Pub/Sub, and Firestore)
Infrastructure as Code (IaC) (opens in a new tab) is the practice of declaring Google Cloud infrastructure in versioned configuration files so development, test, and production stay consistent and repeatable. Terraform describes the desired end state, and automation compares that state to real resources, previews differences, and actuates changes. Infrastructure Manager (opens in a new tab) is the managed Google Cloud service that deploys Terraform configurations, called blueprints, without running a separate toolchain.
Resource modularization is the packaging of related infrastructure into reusable Terraform units. A Terraform module provisions a tested set of resources such as virtual machines, networking, storage, and database connections together, and every configuration starts from a Terraform root module. Input variables customize the same module for different environments without changing its code, while outputs expose IDs or endpoints for other modules to reference.
Reuse across environments uses source control as the single source of truth with an ordered GitOps promotion:
terraform plan for review without applying changes.dev branch, which applies manifests to the development environment for testing.dev into prod after testing, which applies the same tested configuration to production.This flow ensures production only receives changes already validated in development, with full history, review, audit, and revert.
The Terraform execution lifecycle turns declarative files into provisioned resources in a fixed order. Execution starts with terraform init to initialize providers, then terraform validate to check syntax, then terraform plan to generate a reviewable execution plan, then terraform apply to create or update resources through Google Cloud APIs, or terraform destroy to delete a deployment. The Terraform state file is the JSON mapping that records the last-known infrastructure, so Terraform creates what is in configuration but missing from state, updates what differs, and leaves what matches unchanged.
A process flow showing the Terraform execution order: terraform init initializes providers, terraform validate checks syntax, terraform plan generates a reviewable execution plan, and terraform apply provisions resources through Google Cloud APIs, with terraform destroy shown as the optional teardown path.
Infrastructure Manager runs the same lifecycle through managed deployments and revisions:
init, then validate, then apply or destroy, streaming logs to a managed bucket.A preview deployment shows effects before applying, and each revision stores logs, configuration, resource list, and state file. Shift-left validation can check the JSON plan from terraform plan -out plus terraform show -json against organization policies and Security Health Analytics detectors before apply.
Exam tip: A push to a feature branch runs terraform plan only with nothing applied, while a push to dev or prod applies manifests to that respective environment.
State management is the choice of where the shared Terraform state file lives and who operates the automation around it. A local state file on one laptop cannot keep a team consistent, so a remote backend provides one shared record that all engineers and pipelines read and update. Shared state lets the same configuration build repeatable environments, enables review and validation, preserves audit history, and lets pipelines deploy without manual steps.
| Option | Where state lives | Choose when |
|---|---|---|
| Cloud Storage backend with Cloud Build | State file in a Cloud Storage bucket shared by engineers and build triggers | The team wants GitOps automation where branch pushes drive plan and apply |
| Infrastructure Manager | State file stored by Infrastructure Manager for each deployment and revision | The team wants managed toolchain and revision history without running Terraform infrastructure |
| Terraform Cloud | State and secrets stored in remote Terraform Cloud environment | The organization needs full change management, version control connections, and API integration |
Terraform Cloud connects to GitHub, GitLab, and Bitbucket so commits trigger plans, and Terraform Enterprise is its self-hosted distribution for strict compliance needs. An Infrastructure Manager blueprint must include a valid root module and should not define backend blocks, and sensitive values such as passwords must not be placed in configuration values.
Continue with this study guide: Infrastructure as Code (e.g., IaC and Terraform)
Secure and efficient API access is the combination of private network paths, perimeter controls, fast interfaces, and correct authentication for programmatic calls to Google Cloud. Google Cloud APIs run on subdomains of googleapis.com and accept HTTP and gRPC requests directly or through client libraries, with billing and quota attributed to a project. Private paths keep internal workloads off the public internet while perimeter checks still control data movement.
Private connectivity is the use of internal network paths from virtual private cloud (VPC) resources to Google APIs without public addresses. Private Google Access is a subnet-level feature that lets VMs with only private internal IP addresses reach Google APIs while remaining within Google's network, and Private Service Connect endpoints provide an alternative private path from a VPC to Google APIs. Organizational policies restrict which resources can receive external IPs, firewall policies control allowed traffic, and Cloud NAT or Secure Web Proxy provide controlled outbound internet when needed.
VPC Service Controls creates a logical service perimeter around projects, networks, and Google-managed services to block data movement outside authorized boundaries. A perimeter cannot span organizations, but perimeter bridges allow controlled communication between perimeters. Every API request passes ordered checks from entry through the Google Front End, then authentication with end-user context, then Identity and Access Management (IAM), quota, billing, logging, and VPC Service Controls checks, and only then is forwarded to backend services. A request from outside the perimeter is therefore denied even with valid credentials.
Exam tip: VMs with only private IP addresses cannot reach Google APIs by default — enable Private Google Access on the subnet or create Private Service Connect endpoints.
Performance optimization means using the fastest interface, placing traffic near backends, and controlling request rates and dependencies. All Cloud APIs offer a JSON HTTP interface, while most also offer a gRPC interface that provides better performance and usability when called through Google Cloud Client Libraries. All Cloud APIs accept only TLS-encrypted requests, and Private Service Connect keeps enterprise traffic inside VPC networks for security and compliance.
| Interface | How it is called | Performance characteristic |
|---|---|---|
| JSON HTTP | Directly or with Google API Client Libraries | Simple interface available on all Cloud APIs |
| gRPC | With Google Cloud Client Libraries | Better performance and usability where available |
Latency and cost depend on distance and egress. Selecting a region close to private backends minimizes latency, while outbound transfer from Compute Engine, Cloud Storage, Cloud SQL, and Cloud Interconnect can incur egress and regional or zonal bandwidth charges. High-volume delivery combines Apigee, Cloud CDN, Cloud Load Balancing with hybrid connectivity, and Cloud Armor for DDoS protection, with an API gateway acting as a facade that shields clients from backend changes. Reliability controls include Pub/Sub publisher flow control, client-library retries, and Vector Search autoscaling, while minimizing synchronous calls across environments avoids slowdowns and extra egress. Resource-based APIs charge quota to the resource's project, while client-based APIs charge quota to the client's project.
Application Default Credentials (ADC) (opens in a new tab) is the portable mechanism where client libraries automatically discover credentials for the environment where code runs. The request flow runs from workload code to the client library to ADC to the configured credential source, then to the Google Cloud API. The same code uses user credentials during local development and short-lived service account credentials on Google Cloud, but ADC cannot authenticate gcloud commands or API-key requests.
| Environment | Credential ADC uses | Key behavior |
|---|---|---|
| Local development | User credentials in local ADC file | Same code authenticates as the developer for building and testing |
| Google Cloud compute resource | Service account attached to the resource | Same code authenticates as the attached service account in production |
Local setup installs the CLI, runs gcloud init, then runs gcloud auth application-default login to store credentials, which is unnecessary in Cloud Shell because credentials already exist. On Google Cloud, the attached service account is preferred because no key file is managed in code, and for most services it must be attached at creation time except Compute Engine, which allows attaching later. Service account impersonation lets a caller with iam.serviceAccounts.getAccessToken, in the Token Creator role, act temporarily as a service account without downloading keys, configured for gcloud with auth/impersonate_service_account or for Go, Java, Node.js, and Python client libraries with an impersonated ADC file. Federation through Workforce and Workload Identity Federation extends the same model to external users and workloads.
Continue with this study guide: Accessing Google API best practices
Google API client libraries are the code packages that let applications call Google Cloud services programmatically with authentication, retry, and validation handled by the library. Cloud Client Libraries are the recommended idiomatic suite built around service metaphors, while Google API Client Libraries provide pre-built coverage for broader Google API surfaces. Both paths call the same underlying API endpoints, but the developer experience differs.
Authentication via Application Default Credentials (ADC) is the standard way for client libraries to find credentials without hard-coded keys. During local development, ADC checks the local credential file created by gcloud auth application-default login after gcloud init, while on Google Cloud it checks the service account attached to the compute resource such as a Compute Engine VM. Authorization then depends on IAM permissions granted to that user or service account.
Direct REST calls reuse the same identity by running gcloud auth print-access-token and sending the short-lived token as an Authorization: Bearer header with curl or PowerShell to endpoints such as https://iam.googleapis.com. Service account impersonation lets local code act as a service account without downloading long-lived keys when user credentials are not feasible or exact service-account permissions must be tested. The caller needs iam.serviceAccounts.getAccessToken in the Service Account Token Creator role, and impersonation is configured separately for gcloud calls and for ADC files used by Go, Java, Node.js, and Python libraries.
Exam tip: Attach the service account at resource creation time for most Google Cloud services, because only Compute Engine lets you attach a service account to an existing VM instance.
Library selection is the choice of which suite has idiomatic coverage for the target language and service. Cloud Client Libraries (opens in a new tab) use each language's natural conventions and high-level abstractions that hide raw API details and reduce boilerplate, with support across C++, Go, Java, Rust, Node.js, Python, Ruby, PHP, and .NET checked per service. Google API Client Libraries provide pre-built access including services such as the App Engine Admin API, support experimentation in the APIs Explorer, and can be generated through the Google API Discovery Service from a machine-readable discovery document when no idiomatic package exists.
| Library suite | Design approach | Developer experience |
|---|---|---|
| Cloud Client Libraries | Idiomatic, high-level abstractions organized around service metaphors | Follows language conventions, works with standard library, reduces boilerplate |
| Google API Client Libraries | Pre-built libraries or clients built from discovery document | Exposes underlying API surface and supports many languages |
Choose Cloud Client Libraries when a package exists for the language and service combination, and use Google API Client Libraries or a Discovery-built client as the fallback path for broader coverage or missing combinations.
Operational robustness is the practice of keeping API-calling applications reliable under transient failures, quota limits, and high volume. Cloud Client Libraries manage authentication, TLS encryption to googleapis.com over public or VPC networks, error handling, retry for transient failures, and payload validation, so application code does not rebuild those steps. Requests should reuse one session client instance so authentication and the access token, typically valid for one hour, are shared across calls instead of repeating expensive setup.
Creating a new client per request repeats authentication over the network and can trigger authentication rate limiting. Production dependencies should also stay predictable by pinning library versions with npm, pip, or other package managers, especially for beta clients, while still upgrading on a plan to gain fixes and semantic-versioned improvements. Monitoring uses the API Dashboard for traffic, errors, and latency and Cloud Monitoring for dashboards and alerts, while quotas enforce fair use and spending control. Resource-based APIs attribute billing and quota to the resource's project, while client-based APIs attribute them to the client's project.
Continue with this study guide: Google API client libraries
$HOME persist on the 5 GB per-user disk.gcloud storage is the recommended Cloud Storage tool with automatic parallelism, while gsutil requires -m and will no longer ship with the Google Cloud CLI after March 2027.BIGTABLE_EMULATOR_HOST, PUBSUB_EMULATOR_HOST, and SPANNER_EMULATOR_HOST are set.terraform init, then terraform validate, then terraform plan, then terraform apply, with state stored as a shared JSON mapping.gcloud commands or API key requests.Only files under $HOME persist between Cloud Shell sessions on the free 5 GB per-user persistent disk, while any change outside $HOME is lost when the temporary virtual machine terminates after 40 minutes of inactivity. Starting a new session provisions a fresh virtual machine and reattaches the existing home directory, so scripts and files in $HOME survive while system state resets.
gcloud storage is the recommended tool inside the Google Cloud CLI with built-in parallel processing and support for current features, while gsutil is a legacy minimally maintained application that will no longer ship with the CLI after March 2027. gcloud storage applies parallelism automatically whereas gsutil requires an explicit -m flag, and at least one side of a gcloud storage transfer must be a Cloud Storage URI so local-to-local copies are not allowed.
Application Default Credentials lets the same code use user credentials in the local ADC file during local development and the attached service account on a Google Cloud compute resource in production. Local setup stores credentials after running gcloud init and gcloud auth application-default login, while on Google Cloud no key file is managed in code because the attached service account is used, but Application Default Credentials cannot authenticate gcloud commands or API key requests.
The Terraform execution order is terraform init to initialize providers, then terraform validate to check syntax, then terraform plan to generate a reviewable execution plan, then terraform apply to create or update resources through Google Cloud APIs. The Terraform state file is the JSON mapping that records the last-known infrastructure, so Terraform creates what is in configuration but missing from state, updates what differs, and leaves what matches unchanged.
Last updated