---
title: "POST /v1/{+parent}/workstationConfigs"
method: POST
path: "/v1/{+parent}/workstationConfigs"
tags: ["projects"]
---

# POST /v1/{+parent}/workstationConfigs

`POST /v1/{+parent}/workstationConfigs`

Creates a new workstation configuration.

## Path parameters

- `parent` string, required

## Query parameters

- `validateOnly` boolean
- `workstationConfigId` string

## Request body

- WorkstationConfig — A workstation configuration resource in the Cloud Workstations API. Workstation configurations act as templates for workstations. The workstation configuration defines details such as the workstation virtual machine (VM) instance type, persistent storage, container image defining environment, which IDE or Code Editor to use, and more. Administrators and platform teams can also use [Identity and Access Management (IAM)](https://cloud.google.com/iam/docs/overview) rules to grant access to teams or to individual developers.
  - `annotations` object — Optional. Client-specified annotations.
  - `degraded` boolean — Output only. Whether this workstation configuration is in degraded mode, in which case it may require user action to restore full functionality. The conditions field contains detailed information about the status of the configuration.
  - `labels` object — Optional. [Labels](https://cloud.google.com/workstations/docs/label-resources) that are applied to the workstation configuration and that are also propagated to the underlying Compute Engine resources.
  - `displayName` string — Optional. Human-readable name for this workstation configuration.
  - `name` string — Identifier. Full name of this workstation configuration.
  - `encryptionKey` CustomerEncryptionKey — A customer-managed encryption key (CMEK) for the Compute Engine resources of the associated workstation configuration. Specify the name of your Cloud KMS encryption key and the default service account. We recommend that you use a separate service account and follow [Cloud KMS best practices](https://cloud.google.com/kms/docs/separation-of-duties).
    - `kmsKey` string — Immutable. The name of the Google Cloud KMS encryption key. For example, `"projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"`. The key must be in the same region as the workstation configuration.
    - `kmsKeyServiceAccount` string — Immutable. The service account to use with the specified KMS key. We recommend that you use a separate service account and follow KMS best practices. For more information, see [Separation of duties](https://cloud.google.com/kms/docs/separation-of-duties) and `gcloud kms keys add-iam-policy-binding` [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member).
  - `idleTimeout` string, google-duration — Optional. Number of seconds to wait before automatically stopping a workstation after it last received user traffic. A value of `"0s"` indicates that Cloud Workstations VMs created with this configuration should never time out due to idleness. Provide [duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration) terminated by `s` for seconds—for example, `"7200s"` (2 hours). The default is `"1200s"` (20 minutes).
  - `conditions` Status[] — Output only. Status conditions describing the workstation configuration's current state.
    - `code` integer — The status code, which should be an enum value of google.rpc.Code.
    - `message` string — A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
    - `details` object[] — A list of messages that carry the error details. There is a common set of message types for APIs to use.
  - `enableAuditAgent` boolean — Optional. Whether to enable Linux `auditd` logging on the workstation. When enabled, a service_account must also be specified that has `roles/logging.logWriter` and `roles/monitoring.metricWriter` on the project. Operating system audit logging is distinct from [Cloud Audit Logs](https://cloud.google.com/workstations/docs/audit-logging) and [Container output logging](https://cloud.google.com/workstations/docs/container-output-logging#overview). Operating system audit logs are available in the [Cloud Logging](https://cloud.google.com/logging/docs) console by querying: resource.type="gce_instance" log_name:"/logs/linux-auditd"
  - `replicaZones` string[] — Optional. Immutable. Specifies the zones used to replicate the VM and disk resources within the region. If set, exactly two zones within the workstation cluster's region must be specified—for example, `['us-central1-a', 'us-central1-f']`. If this field is empty, two default zones within the region are used. Immutable after the workstation configuration is created.
  - `disableTcpConnections` boolean — Optional. Disables support for plain TCP connections in the workstation. By default the service supports TCP connections through a websocket relay. Setting this option to true disables that relay, which prevents the usage of services that require plain TCP connections, such as SSH. When enabled, all communication must occur over HTTPS or WSS.
  - `grantWorkstationAdminRoleOnCreate` boolean — Optional. Grant creator of a workstation `roles/workstations.policyAdmin` role along with `roles/workstations.user` role on the workstation created by them. This allows workstation users to share access to either their entire workstation, or individual ports. Defaults to false.
  - `runningTimeout` string, google-duration — Optional. Number of seconds that a workstation can run until it is automatically shut down. We recommend that workstations be shut down daily to reduce costs and so that security updates can be applied upon restart. The idle_timeout and running_timeout fields are independent of each other. Note that the running_timeout field shuts down VMs after the specified time, regardless of whether or not the VMs are idle. Provide duration terminated by `s` for seconds—for example, `"54000s"` (15 hours). Defaults to `"43200s"` (12 hours). A value of `"0s"` indicates that workstations using this configuration should never time out. If encryption_key is set, it must be greater than `"0s"` and less than `"86400s"` (24 hours). Warning: A value of `"0s"` indicates that Cloud Workstations VMs created with this configuration have no maximum running time. This is strongly discouraged because you incur costs and will not pick up security updates.
  - `reconciling` boolean — Output only. Indicates whether this workstation configuration is currently being updated to match its intended state.
  - `updateTime` string, google-datetime — Output only. Time when this workstation configuration was most recently updated.
  - `ephemeralDirectories` EphemeralDirectory[] — Optional. Ephemeral directories which won't persist across workstation sessions.
    - `mountPath` string — Required. Location of this directory in the running workstation.
    - `gcePd` GcePersistentDisk — An EphemeralDirectory is backed by a Compute Engine persistent disk.
      - `diskType` string — Optional. Type of the disk to use. Defaults to `"pd-standard"`.
      - `sourceImage` string — Optional. Name of the disk image to use as the source for the disk. Must be empty if source_snapshot is set. Updating source_image will update content in the ephemeral directory after the workstation is restarted. Only file systems supported by Container-Optimized OS (COS) are explicitly supported. For a list of supported file systems, please refer to the [COS documentation](https://cloud.google.com/container-optimized-os/docs/concepts/supported-filesystems). This field is mutable.
      - `sourceSnapshot` string — Optional. Name of the snapshot to use as the source for the disk. Must be empty if source_image is set. Must be empty if read_only is false. Updating source_snapshot will update content in the ephemeral directory after the workstation is restarted. Only file systems supported by Container-Optimized OS (COS) are explicitly supported. For a list of supported file systems, see [the filesystems available in Container-Optimized OS](https://cloud.google.com/container-optimized-os/docs/concepts/supported-filesystems). This field is mutable.
      - `readOnly` boolean — Optional. Whether the disk is read only. If true, the disk may be shared by multiple VMs and source_snapshot must be set.
  - `host` Host — Runtime host for a workstation.
    - `gceInstance` GceInstance — A runtime using a Compute Engine instance.
      - `disableSsh` boolean — Optional. Whether to disable SSH access to the VM.
      - `boostConfigs` BoostConfig[] — Optional. A list of the boost configurations that workstations created using this workstation configuration are allowed to use. If specified, users will have the option to choose from the list of boost configs when starting a workstation.
        - `machineType` string — Optional. The type of machine that boosted VM instances will use—for example, `e2-standard-4`. For more information about machine types that Cloud Workstations supports, see the list of [available machine types](https://cloud.google.com/workstations/docs/available-machine-types). Defaults to `e2-standard-4`.
        - `accelerators` Accelerator[] — Optional. A list of the type and count of accelerator cards attached to the boost instance. Defaults to `none`.
          - `count` integer — Optional. Number of accelerator cards exposed to the instance.
          - `type` string — Optional. Type of accelerator resource to attach to the instance, for example, `"nvidia-tesla-p100"`.
        - `enableNestedVirtualization` boolean — Optional. Whether to enable nested virtualization on boosted Cloud Workstations VMs running using this boost configuration. Defaults to false. Nested virtualization lets you run virtual machine (VM) instances inside your workstation. Before enabling nested virtualization, consider the following important considerations. Cloud Workstations instances are subject to the [same restrictions as Compute Engine instances](https://cloud.google.com/compute/docs/instances/nested-virtualization/overview#restrictions): * **Organization policy**: projects, folders, or organizations may be restricted from creating nested VMs if the **Disable VM nested virtualization** constraint is enforced in the organization policy. For more information, see the Compute Engine section, [Checking whether nested virtualization is allowed](https://cloud.google.com/compute/docs/instances/nested-virtualization/managing-constraint#checking_whether_nested_virtualization_is_allowed). * **Performance**: nested VMs might experience a 10% or greater decrease in performance for workloads that are CPU-bound and possibly greater than a 10% decrease for workloads that are input/output bound. * **Machine Type**: nested virtualization can only be enabled on boost configurations that specify a machine_type in the N1 or N2 machine series.
        - `poolSize` integer — Optional. The number of boost VMs that the system should keep idle so that workstations can be boosted quickly. Defaults to `0`.
        - `bootDiskSizeGb` integer — Optional. The size of the boot disk for the VM in gigabytes (GB). The minimum boot disk size is `30` GB. Defaults to `50` GB.
        - `id` string — Required. The ID to be used for the boost configuration.
      - `vmTags` object — Optional. Resource manager tags to be bound to this instance. Tag keys and values have the same definition as [resource manager tags](https://cloud.google.com/resource-manager/docs/tags/tags-overview). Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`.
      - `instanceMetadata` object — Optional. Custom metadata to apply to Compute Engine instances.
      - `poolSize` integer — Optional. The number of VMs that the system should keep idle so that new workstations can be started quickly for new users. Defaults to `0` in the API.
      - `pooledInstances` integer — Output only. Number of instances currently available in the pool for faster workstation startup.
      - `machineType` string — Optional. The type of machine to use for VM instances—for example, `"e2-standard-4"`. For more information about machine types that Cloud Workstations supports, see the list of [available machine types](https://cloud.google.com/workstations/docs/available-machine-types).
      - `startupScriptUri` string — Optional. Link to the startup script stored in Cloud Storage. This script will be run on the host workstation VM when the VM is created. The URI must be of the form gs://{bucket-name}/{object-name}. If specifying a startup script, the service account must have [Permission to access the bucket and script file in Cloud Storage](https://cloud.google.com/storage/docs/access-control/iam-permissions). Otherwise, the script must be publicly accessible. Note that the service regularly updates the OS version of the host VM, and it is the responsibility of the user to ensure the script stays compatible with the OS version.
      - `accelerators` Accelerator[] — Optional. A list of the type and count of accelerator cards attached to the instance.
        - `count` integer — Optional. Number of accelerator cards exposed to the instance.
        - `type` string — Optional. Type of accelerator resource to attach to the instance, for example, `"nvidia-tesla-p100"`.
      - `disablePublicIpAddresses` boolean — Optional. When set to true, disables public IP addresses for VMs. If you disable public IP addresses, you must set up Private Google Access or Cloud NAT on your network. If you use Private Google Access and you use `private.googleapis.com` or `restricted.googleapis.com` for Container Registry and Artifact Registry, make sure that you set up DNS records for domains `*.gcr.io` and `*.pkg.dev`. Defaults to false (VMs have public IP addresses).
      - `enableNestedVirtualization` boolean — Optional. Whether to enable nested virtualization on Cloud Workstations VMs created using this workstation configuration. Defaults to false. Nested virtualization lets you run virtual machine (VM) instances inside your workstation. Before enabling nested virtualization, consider the following important considerations. Cloud Workstations instances are subject to the [same restrictions as Compute Engine instances](https://cloud.google.com/compute/docs/instances/nested-virtualization/overview#restrictions): * **Organization policy**: projects, folders, or organizations may be restricted from creating nested VMs if the **Disable VM nested virtualization** constraint is enforced in the organization policy. For more information, see the Compute Engine section, [Checking whether nested virtualization is allowed](https://cloud.google.com/compute/docs/instances/nested-virtualization/managing-constraint#checking_whether_nested_virtualization_is_allowed). * **Performance**: nested VMs might experience a 10% or greater decrease in performance for workloads that are CPU-bound and possibly greater than a 10% decrease for workloads that are input/output bound. * **Machine Type**: nested virtualization can only be enabled on workstation configurations that specify a machine_type in the N1 or N2 machine series.
      - `confidentialInstanceConfig` GceConfidentialInstanceConfig — A set of Compute Engine Confidential VM instance options.
        - `enableConfidentialCompute` boolean — Optional. Whether the instance has confidential compute enabled.
      - `serviceAccount` string — Optional. The email address of the service account for Cloud Workstations VMs created with this configuration. When specified, be sure that the service account has `logging.logEntries.create` and `monitoring.timeSeries.create` permissions on the project so it can write logs out to Cloud Logging. If using a custom container image, the service account must have [Artifact Registry Reader](https://cloud.google.com/artifact-registry/docs/access-control#roles) permission to pull the specified image. If you as the administrator want to be able to `ssh` into the underlying VM, you need to set this value to a service account for which you have the `iam.serviceAccounts.actAs` permission. Conversely, if you don't want anyone to be able to `ssh` into the underlying VM, use a service account where no one has that permission. If not set, VMs run with a service account provided by the Cloud Workstations service, and the image must be publicly accessible.
      - `serviceAccountScopes` string[] — Optional. Scopes to grant to the service_account. When specified, users of workstations under this configuration must have `iam.serviceAccounts.actAs` on the service account.
      - `bootDiskSizeGb` integer — Optional. The size of the boot disk for the VM in gigabytes (GB). The minimum boot disk size is `30` GB. Defaults to `50` GB.
      - `shieldedInstanceConfig` GceShieldedInstanceConfig — A set of Compute Engine Shielded instance options.
        - `enableSecureBoot` boolean — Optional. Whether the instance has Secure Boot enabled.
        - `enableIntegrityMonitoring` boolean — Optional. Whether the instance has integrity monitoring enabled.
        - `enableVtpm` boolean — Optional. Whether the instance has the vTPM enabled.
      - `tags` string[] — Optional. Network tags to add to the Compute Engine VMs backing the workstations. This option applies [network tags](https://cloud.google.com/vpc/docs/add-remove-network-tags) to VMs created with this configuration. These network tags enable the creation of [firewall rules](https://cloud.google.com/workstations/docs/configure-firewall-rules).
  - `persistentDirectories` PersistentDirectory[] — Optional. Directories to persist across workstation sessions.
    - `gcePd` GceRegionalPersistentDisk — A Persistent Directory backed by a Compute Engine regional persistent disk. The persistent_directories field is repeated, but it may contain only one entry. It creates a [persistent disk](https://cloud.google.com/compute/docs/disks/persistent-disks) that mounts to the workstation VM at `/home` when the session starts and detaches when the session ends. If this field is empty, workstations created with this configuration do not have a persistent home directory.
      - `sourceSnapshot` string — Optional. Name of the snapshot to use as the source for the disk. If set, size_gb and fs_type must be empty. Must be formatted as ext4 file system with no partitions.
      - `diskType` string — Optional. The [type of the persistent disk](https://cloud.google.com/compute/docs/disks#disk-types) for the home directory. Defaults to `"pd-standard"`.
      - `reclaimPolicy` 'RECLAIM_POLICY_UNSPECIFIED' | 'DELETE' | 'RETAIN' — Optional. Whether the persistent disk should be deleted when the workstation is deleted. Valid values are `DELETE` and `RETAIN`. Defaults to `DELETE`.
      - `archiveTimeout` string, google-duration — Optional. Number of seconds to wait after initially creating or subsequently shutting down the workstation before converting its disk into a snapshot. This generally saves costs at the expense of greater startup time on next workstation start, as the service will need to create a disk from the archival snapshot. A value of `"0s"` indicates that the disk will never be archived.
      - `sizeGb` integer — Optional. The GB capacity of a persistent home directory for each workstation created with this configuration. Must be empty if source_snapshot is set. Valid values are `10`, `50`, `100`, `200`, `500`, or `1000`. Defaults to `200`. If less than `200` GB, the disk_type must be `"pd-balanced"` or `"pd-ssd"`.
      - `maxSizeGb` integer — Optional. Maximum size in GB to which this persistent directory can be resized. Defaults to unlimited if not set.
      - `fsType` string — Optional. Type of file system that the disk should be formatted with. The workstation image must support this file system type. Must be empty if source_snapshot is set. Defaults to `"ext4"`.
    - `gceHd` GceHyperdiskBalancedHighAvailability — A Persistent Directory backed by a Compute Engine [Hyperdisk Balanced High Availability Disk](https://cloud.google.com/compute/docs/disks/hd-types/hyperdisk-balanced-ha). This is a high-availability block storage solution that offers a balance between performance and cost for most general-purpose workloads.
      - `sizeGb` integer — Optional. The GB capacity of a persistent home directory for each workstation created with this configuration. Must be empty if source_snapshot is set. Valid values are `10`, `50`, `100`, `200`, `500`, or `1000`. Defaults to `200`.
      - `maxSizeGb` integer — Optional. Maximum size in GB to which this persistent directory can be resized. Defaults to unlimited if not set.
      - `reclaimPolicy` 'RECLAIM_POLICY_UNSPECIFIED' | 'DELETE' | 'RETAIN' — Optional. Whether the persistent disk should be deleted when the workstation is deleted. Valid values are `DELETE` and `RETAIN`. Defaults to `DELETE`.
      - `archiveTimeout` string, google-duration — Optional. Number of seconds to wait after initially creating or subsequently shutting down the workstation before converting its disk into a snapshot. This generally saves costs at the expense of greater startup time on next workstation start, as the service will need to create a disk from the archival snapshot. A value of `"0s"` indicates that the disk will never be archived.
      - `sourceSnapshot` string — Optional. Name of the snapshot to use as the source for the disk. If set, size_gb must be empty. Must be formatted as ext4 file system with no partitions.
    - `mountPath` string — Optional. Location of this directory in the running workstation.
  - `createTime` string, google-datetime — Output only. Time when this workstation configuration was created.
  - `allowedPorts` PortRange[] — Optional. A list of PortRanges specifying single ports or ranges of ports that are externally accessible in the workstation. Allowed ports must be one of 22, 80, or within range 1024-65535. If not specified defaults to ports 22, 80, and ports 1024-65535.
    - `first` integer — Required. Starting port number for the current range of ports. Valid ports are 22, 80, and ports within the range 1024-65535.
    - `last` integer — Required. Ending port number for the current range of ports. Valid ports are 22, 80, and ports within the range 1024-65535.
  - `uid` string — Output only. A system-assigned unique identifier for this workstation configuration.
  - `maxUsableWorkstations` integer — Optional. Maximum number of workstations under this configuration a user can have `workstations.workstation.use` permission on. Only enforced on CreateWorkstation API calls on the user issuing the API request. Can be overridden by: - granting a user workstations.workstationConfigs.exemptMaxUsableWorkstationLimit permission, or - having a user with that permission create a workstation and granting another user `workstations.workstation.use` permission on that workstation. If not specified, defaults to `0`, which indicates unlimited.
  - `deleteTime` string, google-datetime — Output only. Time when this workstation configuration was soft-deleted.
  - `container` Container — A Docker container.
    - `image` string — Optional. A Docker container image that defines a custom environment. Cloud Workstations provides a number of [preconfigured images](https://cloud.google.com/workstations/docs/preconfigured-base-images), but you can create your own [custom container images](https://cloud.google.com/workstations/docs/custom-container-images). If using a private image, the `host.gceInstance.serviceAccount` field must be specified in the workstation configuration. If using a custom container image, the service account must have [Artifact Registry Reader](https://cloud.google.com/artifact-registry/docs/access-control#roles) permission to pull the specified image. Otherwise, the image must be publicly accessible.
    - `args` string[] — Optional. Arguments passed to the entrypoint.
    - `workingDir` string — Optional. If set, overrides the default DIR specified by the image.
    - `command` string[] — Optional. If set, overrides the default ENTRYPOINT specified by the image.
    - `env` object — Optional. Environment variables passed to the container's entrypoint.
    - `runAsUser` integer — Optional. If set, overrides the USER specified in the image with the given uid.
  - `etag` string — Optional. Checksum computed by the server. May be sent on update and delete requests to make sure that the client has an up-to-date value before proceeding.
  - `readinessChecks` ReadinessCheck[] — Optional. Readiness checks to perform when starting a workstation using this workstation configuration. Mark a workstation as running only after all specified readiness checks return 200 status codes.
    - `path` string — Optional. Path to which the request should be sent.
    - `port` integer — Optional. Port to which the request should be sent.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/workstations.md) · [All operations](https://skmtc.dev/google/apis/workstations/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/workstations/revisions/fb7c28fdc534/schema)
