GCP.Workstations reference
GenerateAccessToken
Section titled “GenerateAccessToken”Source:
src/GCP/Workstations/GenerateAccessToken.ts
Runtime binding for Cloud Workstations workstations.generateAccessToken.
Bind this operation to a
WorkstationClustersWorkstationConfigsWorkstation in a
Function/Action init phase. Provide GenerateAccessTokenHttp.
Grants roles/workstations.user on the workstation only.
GenerateAccessToken: Authenticating to a Workstation
Section titled “GenerateAccessToken: Authenticating to a Workstation”const generate = yield* GCP.Workstations.GenerateAccessToken(dev);const { accessToken, expireTime } = yield* generate({ body: { ttl: "3600s" },});GenerateAccessTokenHttp
Section titled “GenerateAccessTokenHttp”Source:
src/GCP/Workstations/GenerateAccessTokenHttp.tsKind: Layer · Provides:GCP.Workstations.GenerateAccessToken
HTTP implementation of GenerateAccessToken.
GetWorkstation
Section titled “GetWorkstation”Source:
src/GCP/Workstations/GetWorkstation.ts
Runtime binding for Cloud Workstations workstations.get.
Bind this operation to a
WorkstationClustersWorkstationConfigsWorkstation in a
Function/Action init phase. Provide GetWorkstationHttp.
Grants roles/workstations.viewer on the workstation only.
GetWorkstation: Observing Workstations
Section titled “GetWorkstation: Observing Workstations”const getWorkstation = yield* GCP.Workstations.GetWorkstation(dev);const live = yield* getWorkstation();GetWorkstationCluster
Section titled “GetWorkstationCluster”Source:
src/GCP/Workstations/GetWorkstationCluster.ts
Runtime binding for Cloud Workstations workstationClusters.get.
Bind this operation to a WorkstationCluster in a Function/Action
init phase. Provide GetWorkstationClusterHttp.
Grants roles/workstations.viewer on the project because workstation
clusters have no IAM policy of their own.
GetWorkstationCluster: Observing Clusters
Section titled “GetWorkstationCluster: Observing Clusters”const getCluster = yield* GCP.Workstations.GetWorkstationCluster(cluster);const live = yield* getCluster();GetWorkstationClusterHttp
Section titled “GetWorkstationClusterHttp”Source:
src/GCP/Workstations/GetWorkstationClusterHttp.tsKind: Layer · Provides:GCP.Workstations.GetWorkstationCluster
HTTP implementation of GetWorkstationCluster.
GetWorkstationConfig
Section titled “GetWorkstationConfig”Source:
src/GCP/Workstations/GetWorkstationConfig.ts
Runtime binding for Cloud Workstations workstationConfigs.get.
Bind this operation to a WorkstationClustersWorkstationConfig in
a Function/Action init phase. Provide GetWorkstationConfigHttp.
Grants roles/workstations.viewer on the configuration only.
GetWorkstationConfig: Observing Configurations
Section titled “GetWorkstationConfig: Observing Configurations”const getConfig = yield* GCP.Workstations.GetWorkstationConfig(config);const live = yield* getConfig();GetWorkstationConfigHttp
Section titled “GetWorkstationConfigHttp”Source:
src/GCP/Workstations/GetWorkstationConfigHttp.tsKind: Layer · Provides:GCP.Workstations.GetWorkstationConfig
HTTP implementation of GetWorkstationConfig.
GetWorkstationHttp
Section titled “GetWorkstationHttp”Source:
src/GCP/Workstations/GetWorkstationHttp.tsKind: Layer · Provides:GCP.Workstations.GetWorkstation
HTTP implementation of GetWorkstation.
StartWorkstation
Section titled “StartWorkstation”Source:
src/GCP/Workstations/StartWorkstation.ts
Runtime binding for Cloud Workstations workstations.start.
Bind this operation to a
WorkstationClustersWorkstationConfigsWorkstation in a
Function/Action init phase. Provide StartWorkstationHttp.
Grants roles/workstations.user on the workstation only.
StartWorkstation: Starting a Workstation
Section titled “StartWorkstation: Starting a Workstation”const start = yield* GCP.Workstations.StartWorkstation(dev);yield* start();StartWorkstationHttp
Section titled “StartWorkstationHttp”Source:
src/GCP/Workstations/StartWorkstationHttp.tsKind: Layer · Provides:GCP.Workstations.StartWorkstation
HTTP implementation of StartWorkstation.
StopWorkstation
Section titled “StopWorkstation”Source:
src/GCP/Workstations/StopWorkstation.ts
Runtime binding for Cloud Workstations workstations.stop.
Bind this operation to a
WorkstationClustersWorkstationConfigsWorkstation in a
Function/Action init phase. Provide StopWorkstationHttp.
Grants roles/workstations.user on the workstation only.
StopWorkstation: Stopping a Workstation
Section titled “StopWorkstation: Stopping a Workstation”const stop = yield* GCP.Workstations.StopWorkstation(dev);yield* stop();StopWorkstationHttp
Section titled “StopWorkstationHttp”Source:
src/GCP/Workstations/StopWorkstationHttp.tsKind: Layer · Provides:GCP.Workstations.StopWorkstation
HTTP implementation of StopWorkstation.
WorkstationCluster
Section titled “WorkstationCluster”Source:
src/GCP/Workstations/WorkstationCluster.ts
A Cloud Workstations cluster — a regional group of workstations attached to a VPC network.
Changing workstationClusterId, location, network, subnetwork,
domainConfig, tags, or privateClusterConfig.enablePrivateEndpoint
replaces the cluster. Display name, labels, annotations, launch URLs,
gateway config, and allowedProjects update in place.
WorkstationCluster: Creating a Cluster
Section titled “WorkstationCluster: Creating a Cluster”Generated name on the default VPC
const cluster = yield* GCP.Workstations.WorkstationCluster("Dev", {});Explicit id, network, and labels
const cluster = yield* GCP.Workstations.WorkstationCluster("Dev", { workstationClusterId: "app-dev", location: "us-central1", network: "default", subnetwork: "default", displayName: "app-dev workstations", labels: { env: "prod" },});WorkstationCluster: Updating a Cluster
Section titled “WorkstationCluster: Updating a Cluster”// Same logical id, changed props: the engine updates it in place.const cluster = yield* GCP.Workstations.WorkstationCluster("Dev", { displayName: "app-dev workstations v2", labels: { env: "prod", team: "platform" },});WorkstationClustersWorkstationConfig
Section titled “WorkstationClustersWorkstationConfig”Source:
src/GCP/Workstations/WorkstationClustersWorkstationConfig.ts
A Cloud Workstations configuration — the template for workstation VMs (machine type, image, disks, timeouts).
Changing workstationConfigId, location, workstationCluster,
replicaZones, or encryptionKey replaces the configuration. Display
name, labels, container, host, timeouts, directories, and ports update
in place.
WorkstationClustersWorkstationConfig: Creating a Configuration
Section titled “WorkstationClustersWorkstationConfig: Creating a Configuration”Generated name
const config = yield* GCP.Workstations.WorkstationClustersWorkstationConfig( "Code", { workstationCluster: cluster.name },);Custom machine type and image
const config = yield* GCP.Workstations.WorkstationClustersWorkstationConfig( "Code", { workstationCluster: cluster.name, idleTimeout: "1800s", host: { gceInstance: { machineType: "e2-standard-4", poolSize: 0 } }, labels: { env: "prod" }, },);WorkstationClustersWorkstationConfig: Updating a Configuration
Section titled “WorkstationClustersWorkstationConfig: Updating a Configuration”// Same logical id, changed props: the engine updates it in place.const config = yield* GCP.Workstations.WorkstationClustersWorkstationConfig( "Code", { workstationCluster: cluster.name, displayName: "code v2", idleTimeout: "3600s", },);WorkstationClustersWorkstationConfigsWorkstation
Section titled “WorkstationClustersWorkstationConfigsWorkstation”Source:
src/GCP/Workstations/WorkstationClustersWorkstationConfigsWorkstation.ts
A Cloud Workstations workstation — a single developer VM with its own persistent storage, created from a workstation configuration.
Changing workstationId, location, workstationConfig,
workstationCluster, or sourceWorkstation replaces the workstation.
Display name, labels, annotations, env, and persistent directory size
update in place.
WorkstationClustersWorkstationConfigsWorkstation: Creating a Workstation
Section titled “WorkstationClustersWorkstationConfigsWorkstation: Creating a Workstation”Generated name
const workstation = yield* GCP.Workstations.WorkstationClustersWorkstationConfigsWorkstation( "Mine", { workstationConfig: config.name }, );Explicit id and labels
const workstation = yield* GCP.Workstations.WorkstationClustersWorkstationConfigsWorkstation( "Mine", { workstationConfig: config.name, displayName: "alice-dev", labels: { env: "prod" }, }, );WorkstationClustersWorkstationConfigsWorkstation: Updating a Workstation
Section titled “WorkstationClustersWorkstationConfigsWorkstation: Updating a Workstation”// Same logical id, changed props: the engine updates it in place.const workstation = yield* GCP.Workstations.WorkstationClustersWorkstationConfigsWorkstation( "Mine", { workstationConfig: config.name, displayName: "alice-dev v2", env: { EDITOR: "vim" }, }, );