Skip to content

Instantly share code, notes, and snippets.

@xSAVIKx
Last active October 25, 2025 17:35
Show Gist options
  • Select an option

  • Save xSAVIKx/78eaeb461417f265fda71771cf8bb872 to your computer and use it in GitHub Desktop.

Select an option

Save xSAVIKx/78eaeb461417f265fda71771cf8bb872 to your computer and use it in GitHub Desktop.
GCP Cloud Workstations minimal setup with Pulumi, Typescript and Bun
import * as gcp from "@pulumi/gcp";
const region = "us-central1";
const gcpProvider = new gcp.Provider("gcpProvider", {
project: gcp.config.project,
region: region,
defaultLabels: { team: "devops" },
});
const enableServices = (services: string[]) => {
return services.map((service) => {
return new gcp.projects.Service(
service,
{
service: service,
project: gcp.config.project,
},
{ provider: gcpProvider },
);
});
};
const requiredServices = [
"compute.googleapis.com",
"workstations.googleapis.com",
];
const services = enableServices(requiredServices);
export default async function main() {
const wsNetwork = new gcp.compute.Network(
"wsNetwork",
{
autoCreateSubnetworks: false,
},
{
provider: gcpProvider,
dependsOn: services,
},
);
const wsSubnetwork = new gcp.compute.Subnetwork(
"wsUsCentral1Subnet",
{
network: wsNetwork.id,
region: region,
ipCidrRange: "10.128.0.0/20",
},
{
provider: gcpProvider,
parent: wsNetwork,
},
);
const wsCluster: gcp.workstations.WorkstationCluster =
new gcp.workstations.WorkstationCluster(
"developmentCluster",
{
workstationClusterId: "test-cluster",
network: wsNetwork.id,
subnetwork: wsSubnetwork.id,
location: region,
displayName: "Test Cluster",
annotations: {
description: "Minimal cluster for testing",
},
labels: {
purpose: "test",
},
},
{ provider: gcpProvider, dependsOn: services },
);
const wsMinimalConfig = new gcp.workstations.WorkstationConfig(
"wsMinimalConfig",
{
workstationConfigId: "minimal-config",
workstationClusterId: wsCluster.workstationClusterId,
location: region,
},
{ provider: gcpProvider, dependsOn: services },
);
const workstation = new gcp.workstations.Workstation(
"test-workstation",
{
workstationId: "test-workstation",
workstationConfigId: wsMinimalConfig.workstationConfigId,
workstationClusterId: wsCluster.workstationClusterId,
location: region,
},
{ provider: gcpProvider, dependsOn: services },
);
return {
wsCluster: wsCluster.name,
wsConfig: wsMinimalConfig.name,
workstation: workstation.host,
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment