Google Cloud Workstations: Building Your Development Environment in the Cloud

Stenal P Jolly
Google Cloud - Community
5 min readOct 27, 2024

Imagine your development team spread across multiple continents, each developer needing hours to set up their local environment, facing consistency issues, and dealing with security concerns. Sound familiar? This is where Google Cloud Workstations comes into play.

The Promise of Cloud-Based Development

Cloud Workstation is Google Cloud’s answer to modern development challenges. It’s a fully managed service that provides cloud-based development environments, eliminating the age-old “it works on my machine” problem. Let’s explore how it transforms the way teams write, test, and deploy code.

Understanding the Building Blocks

Think of Cloud Workstations as a virtual office building. Here’s what makes up this digital workspace:

  • Workstation: A virtual machine (VM) instance pre-configured with a specified set of development tools, libraries, and settings. Think of it as your cloud-based development desktop.
  • Workstation cluster: A logical grouping of workstations residing within a single Google Cloud region and Virtual Private Cloud (VPC) network inside a project. Each cluster includes a controller and a gateway to manage and route traffic.
  • Controller: A key component of a workstation cluster responsible for managing the lifecycle of VM instances and other workstation resources within the associated project. It handles creation, deletion, startup, and shutdown of workstations.
  • Gateway: Acts as the entry point for client connections to the workstation cluster. The gateway receives traffic from users and routes it to the appropriate workstation VM instance.
  • Private Service Connect: Establishes a secure and private connection between the Cloud Workstations controller and your VPC network, allowing workstations to access internal resources within your project.
  • Workstation configuration: A blueprint or template that defines the specifications for creating consistent workstations across multiple developers. This includes settings such as machine type, disk size, operating system, pre-installed software (IDEs, SDKs, tools), and startup scripts. Configurations ensure standardized development environments.

Setting Up Your Cloud Development Space

First Steps

Before you can move into your new development space, you’ll need to handle some paperwork:

# Enable the necessary services
gcloud services enable workstations.googleapis.com compute.googleapis.com

You’ll need these permissions in your toolkit:

  • workstations.clusters.create
  • workstations.workstationConfigs.create
  • workstations.workstationClusters.create

Creating Your Workspace

Let’s build your development environment step by step:

  • Set up your cluster:
gcloud workstations clusters create dev-cluster \
--region=us-central1 \
--network=projects/my-project/global/networks/my-network \
--subnetwork=projects/my-project/regions/us-central1/subnetworks/my-subnet \
--enable-private-ip-workstations
  • Configure your workspace:
gcloud workstations configs create dev-config \
--cluster=dev-cluster \
--region=us-central1 \
--machine-type=e2-standard-4 \
--disk-size=100 \
--container-image=gcr.io/cloud-workstations-images/code-oss:latest
  • Create your personal workstation:
gcloud workstations create my-workstation \
--cluster=dev-cluster \
--config=dev-config \
--region=us-central1

Real-World Success Stories

The Security-First Financial Institution

A major financial services company faced a challenge: providing 50+ developers with secure environments while maintaining SOX compliance. Their solution? A custom-configured Cloud Workstation environment with:

  • Private cluster deployment
  • Customer-managed encryption keys
  • Secure boot configuration
  • Automated compliance logging
  • Regular security audits
# Network Configuration
resource "google_compute_network" "secure_network" {
name = "secure-dev-network"
auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "secure_subnet" {
name = "secure-dev-subnet"
ip_cidr_range = "10.2.0.0/16"
network = google_compute_network.secure_network.id
region = "us-central1"

# Enable private Google Access
private_ip_google_access = true
}

# Workstation Cluster with Enhanced Security
resource "google_workstations_workstation_cluster" "secure_cluster" {
provider = google-beta
location = "us-central1"
network = google_compute_network.secure_network.id
subnetwork = google_compute_subnetwork.secure_subnet.id

workstation_cluster_id = "secure-dev-cluster"

private_cluster_config {
enable_private_endpoint = true
}
}

# Secure Configuration Template
resource "google_workstations_workstation_config" "secure_config" {
provider = google-beta
workstation_config_id = "secure-dev-config"
location = "us-central1"
workstation_cluster_id = google_workstations_cluster.secure_cluster.cluster_id

host {
gce_instance {
machine_type = "e2-standard-4"
boot_disk_size_gb = 100
enable_secure_boot = true
}
}

container {
image = "gcr.io/my-project/secure-dev-environment:latest"
env = {
"COMPLIANCE_MODE" = "SOX"
"AUDIT_LOGGING" = "enabled"
}
}
}

The AI Innovation Lab

An AI research team needed powerful workstations for model development. Their Cloud Workstation setup featured:

  • GPU-accelerated instances
  • Large-scale data storage
  • Pre-configured ML frameworks
  • Integrated Jupyter environments
  • Real-time collaboration tools
# GPU-enabled Workstation Configuration
resource "google_workstations_workstation_config" "ml_config" {
provider = google-beta
workstation_config_id = "ml-dev-config"
location = "us-central1"
workstation_cluster_id = google_workstations_cluster.ml_cluster.cluster_id

host {
gce_instance {
machine_type = "n1-standard-8"
boot_disk_size_gb = 200
accelerators {
type = "nvidia-tesla-t4"
count = 1
}
}
}

container {
image = "gcr.io/my-project/ml-workspace:latest"
env = {
"JUPYTER_PORT" = "8888"
"TENSORBOARD_PORT" = "6006"
}
}

persistent_directories {
mount_path = "/workspace/datasets"
gce_pd {
size_gb = 1000
fs_type = "ext4"
reclaim_policy = "RETAIN"
}
}
}

The Global Development Team

A multinational company needed to unite developers across time zones. They implemented:

  • Multi-region workstation clusters
  • Integrated CI/CD pipelines
  • Shared development tools
  • Standardized environments
  • Automated scaling policies

Performance Tips

  • Choose e2-standard-4 or higher for general development
  • Opt for n2-standard-8 for intensive workloads
  • Start with 100GB boot disk minimum
  • Use SSD persistent disks for better performance
  • Configure automatic backup policies

Security Guidelines

  • Enable private IP workstations
  • Implement strict firewall rules
  • Use VPC Service Controls
  • Follow the principle of least privilege
  • Conduct regular access reviews

Cost Management

  • Set up auto-shutdown policies
  • Use preemptible instances where appropriate
  • Implement resource quotas
  • Configure budget alerts
  • Monitor resource utilization

Maintaining Your Environment

Common Challenges and Solutions

When things don’t go as planned, check these areas:

  • Network configuration
  • Firewall rules
  • IAM permissions
  • Resource utilization
  • Disk space
  • Machine type specifications

Regular Maintenance

Keep your environment healthy with:

  • Scheduled maintenance windows
  • Regular container image updates
  • Security patch management
  • Automated backup procedures
  • Documented recovery processes

Tools Integration

Development Environment Support

  • VS Code: Remote development extensions, custom configurations, extension management
  • JetBrains IDEs: Gateway setup, project sync, debugging tools
  • Git Integration: SSH configuration, credential management, repository access

Looking Ahead

Cloud Workstations represents more than just a development environment — it’s a shift in how we think about developer productivity and collaboration. As teams become more distributed and security requirements more stringent, cloud-based development environments will become the norm rather than the exception.

Whether you’re a financial institution managing compliance, an AI team needing powerful computing resources, or a global team seeking consistency, Cloud Workstations provides the foundation for modern development practices.

--

--

Google Cloud - Community
Google Cloud - Community

Published in Google Cloud - Community

A collection of technical articles and blogs published or curated by Google Cloud Developer Advocates. The views expressed are those of the authors and don't necessarily reflect those of Google.

Stenal P Jolly
Stenal P Jolly