com.pulumi.gcp.workstations.kotlin.WorkstationConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.workstations.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigCondition
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigContainer
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigEncryptionKey
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigEphemeralDirectory
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigHost
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigPersistentDirectory
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigReadinessCheck
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigCondition.Companion.toKotlin as workstationConfigConditionToKotlin
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigContainer.Companion.toKotlin as workstationConfigContainerToKotlin
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigEncryptionKey.Companion.toKotlin as workstationConfigEncryptionKeyToKotlin
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigEphemeralDirectory.Companion.toKotlin as workstationConfigEphemeralDirectoryToKotlin
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigHost.Companion.toKotlin as workstationConfigHostToKotlin
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigPersistentDirectory.Companion.toKotlin as workstationConfigPersistentDirectoryToKotlin
import com.pulumi.gcp.workstations.kotlin.outputs.WorkstationConfigReadinessCheck.Companion.toKotlin as workstationConfigReadinessCheckToKotlin
/**
* Builder for [WorkstationConfig].
*/
@PulumiTagMarker
public class WorkstationConfigResourceBuilder internal constructor() {
public var name: String? = null
public var args: WorkstationConfigArgs = WorkstationConfigArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend WorkstationConfigArgsBuilder.() -> Unit) {
val builder = WorkstationConfigArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): WorkstationConfig {
val builtJavaResource = com.pulumi.gcp.workstations.WorkstationConfig(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return WorkstationConfig(builtJavaResource)
}
}
/**
* ## Example Usage
* ### Workstation Config Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.Network("default", {
* name: "workstation-cluster",
* autoCreateSubnetworks: false,
* });
* const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
* name: "workstation-cluster",
* ipCidrRange: "10.0.0.0/24",
* region: "us-central1",
* network: _default.name,
* });
* const defaultWorkstationCluster = new gcp.workstations.WorkstationCluster("default", {
* workstationClusterId: "workstation-cluster",
* network: _default.id,
* subnetwork: defaultSubnetwork.id,
* location: "us-central1",
* labels: {
* label: "key",
* },
* annotations: {
* "label-one": "value-one",
* },
* });
* const defaultWorkstationConfig = new gcp.workstations.WorkstationConfig("default", {
* workstationConfigId: "workstation-config",
* workstationClusterId: defaultWorkstationCluster.workstationClusterId,
* location: "us-central1",
* idleTimeout: "600s",
* runningTimeout: "21600s",
* replicaZones: [
* "us-central1-a",
* "us-central1-b",
* ],
* annotations: {
* "label-one": "value-one",
* },
* labels: {
* label: "key",
* },
* host: {
* gceInstance: {
* machineType: "e2-standard-4",
* bootDiskSizeGb: 35,
* disablePublicIpAddresses: true,
* disableSsh: false,
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.Network("default",
* name="workstation-cluster",
* auto_create_subnetworks=False)
* default_subnetwork = gcp.compute.Subnetwork("default",
* name="workstation-cluster",
* ip_cidr_range="10.0.0.0/24",
* region="us-central1",
* network=default.name)
* default_workstation_cluster = gcp.workstations.WorkstationCluster("default",
* workstation_cluster_id="workstation-cluster",
* network=default.id,
* subnetwork=default_subnetwork.id,
* location="us-central1",
* labels={
* "label": "key",
* },
* annotations={
* "label-one": "value-one",
* })
* default_workstation_config = gcp.workstations.WorkstationConfig("default",
* workstation_config_id="workstation-config",
* workstation_cluster_id=default_workstation_cluster.workstation_cluster_id,
* location="us-central1",
* idle_timeout="600s",
* running_timeout="21600s",
* replica_zones=[
* "us-central1-a",
* "us-central1-b",
* ],
* annotations={
* "label-one": "value-one",
* },
* labels={
* "label": "key",
* },
* host=gcp.workstations.WorkstationConfigHostArgs(
* gce_instance=gcp.workstations.WorkstationConfigHostGceInstanceArgs(
* machine_type="e2-standard-4",
* boot_disk_size_gb=35,
* disable_public_ip_addresses=True,
* disable_ssh=False,
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.Network("default", new()
* {
* Name = "workstation-cluster",
* AutoCreateSubnetworks = false,
* });
* var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
* {
* Name = "workstation-cluster",
* IpCidrRange = "10.0.0.0/24",
* Region = "us-central1",
* Network = @default.Name,
* });
* var defaultWorkstationCluster = new Gcp.Workstations.WorkstationCluster("default", new()
* {
* WorkstationClusterId = "workstation-cluster",
* Network = @default.Id,
* Subnetwork = defaultSubnetwork.Id,
* Location = "us-central1",
* Labels =
* {
* { "label", "key" },
* },
* Annotations =
* {
* { "label-one", "value-one" },
* },
* });
* var defaultWorkstationConfig = new Gcp.Workstations.WorkstationConfig("default", new()
* {
* WorkstationConfigId = "workstation-config",
* WorkstationClusterId = defaultWorkstationCluster.WorkstationClusterId,
* Location = "us-central1",
* IdleTimeout = "600s",
* RunningTimeout = "21600s",
* ReplicaZones = new[]
* {
* "us-central1-a",
* "us-central1-b",
* },
* Annotations =
* {
* { "label-one", "value-one" },
* },
* Labels =
* {
* { "label", "key" },
* },
* Host = new Gcp.Workstations.Inputs.WorkstationConfigHostArgs
* {
* GceInstance = new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceArgs
* {
* MachineType = "e2-standard-4",
* BootDiskSizeGb = 35,
* DisablePublicIpAddresses = true,
* DisableSsh = false,
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workstations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* IpCidrRange: pulumi.String("10.0.0.0/24"),
* Region: pulumi.String("us-central1"),
* Network: _default.Name,
* })
* if err != nil {
* return err
* }
* defaultWorkstationCluster, err := workstations.NewWorkstationCluster(ctx, "default", &workstations.WorkstationClusterArgs{
* WorkstationClusterId: pulumi.String("workstation-cluster"),
* Network: _default.ID(),
* Subnetwork: defaultSubnetwork.ID(),
* Location: pulumi.String("us-central1"),
* Labels: pulumi.StringMap{
* "label": pulumi.String("key"),
* },
* Annotations: pulumi.StringMap{
* "label-one": pulumi.String("value-one"),
* },
* })
* if err != nil {
* return err
* }
* _, err = workstations.NewWorkstationConfig(ctx, "default", &workstations.WorkstationConfigArgs{
* WorkstationConfigId: pulumi.String("workstation-config"),
* WorkstationClusterId: defaultWorkstationCluster.WorkstationClusterId,
* Location: pulumi.String("us-central1"),
* IdleTimeout: pulumi.String("600s"),
* RunningTimeout: pulumi.String("21600s"),
* ReplicaZones: pulumi.StringArray{
* pulumi.String("us-central1-a"),
* pulumi.String("us-central1-b"),
* },
* Annotations: pulumi.StringMap{
* "label-one": pulumi.String("value-one"),
* },
* Labels: pulumi.StringMap{
* "label": pulumi.String("key"),
* },
* Host: &workstations.WorkstationConfigHostArgs{
* GceInstance: &workstations.WorkstationConfigHostGceInstanceArgs{
* MachineType: pulumi.String("e2-standard-4"),
* BootDiskSizeGb: pulumi.Int(35),
* DisablePublicIpAddresses: pulumi.Bool(true),
* DisableSsh: pulumi.Bool(false),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.workstations.WorkstationCluster;
* import com.pulumi.gcp.workstations.WorkstationClusterArgs;
* import com.pulumi.gcp.workstations.WorkstationConfig;
* import com.pulumi.gcp.workstations.WorkstationConfigArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostGceInstanceArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var default_ = new Network("default", NetworkArgs.builder()
* .name("workstation-cluster")
* .autoCreateSubnetworks(false)
* .build());
* var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
* .name("workstation-cluster")
* .ipCidrRange("10.0.0.0/24")
* .region("us-central1")
* .network(default_.name())
* .build());
* var defaultWorkstationCluster = new WorkstationCluster("defaultWorkstationCluster", WorkstationClusterArgs.builder()
* .workstationClusterId("workstation-cluster")
* .network(default_.id())
* .subnetwork(defaultSubnetwork.id())
* .location("us-central1")
* .labels(Map.of("label", "key"))
* .annotations(Map.of("label-one", "value-one"))
* .build());
* var defaultWorkstationConfig = new WorkstationConfig("defaultWorkstationConfig", WorkstationConfigArgs.builder()
* .workstationConfigId("workstation-config")
* .workstationClusterId(defaultWorkstationCluster.workstationClusterId())
* .location("us-central1")
* .idleTimeout("600s")
* .runningTimeout("21600s")
* .replicaZones(
* "us-central1-a",
* "us-central1-b")
* .annotations(Map.of("label-one", "value-one"))
* .labels(Map.of("label", "key"))
* .host(WorkstationConfigHostArgs.builder()
* .gceInstance(WorkstationConfigHostGceInstanceArgs.builder()
* .machineType("e2-standard-4")
* .bootDiskSizeGb(35)
* .disablePublicIpAddresses(true)
* .disableSsh(false)
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Network
* properties:
* name: workstation-cluster
* autoCreateSubnetworks: false
* defaultSubnetwork:
* type: gcp:compute:Subnetwork
* name: default
* properties:
* name: workstation-cluster
* ipCidrRange: 10.0.0.0/24
* region: us-central1
* network: ${default.name}
* defaultWorkstationCluster:
* type: gcp:workstations:WorkstationCluster
* name: default
* properties:
* workstationClusterId: workstation-cluster
* network: ${default.id}
* subnetwork: ${defaultSubnetwork.id}
* location: us-central1
* labels:
* label: key
* annotations:
* label-one: value-one
* defaultWorkstationConfig:
* type: gcp:workstations:WorkstationConfig
* name: default
* properties:
* workstationConfigId: workstation-config
* workstationClusterId: ${defaultWorkstationCluster.workstationClusterId}
* location: us-central1
* idleTimeout: 600s
* runningTimeout: 21600s
* replicaZones:
* - us-central1-a
* - us-central1-b
* annotations:
* label-one: value-one
* labels:
* label: key
* host:
* gceInstance:
* machineType: e2-standard-4
* bootDiskSizeGb: 35
* disablePublicIpAddresses: true
* disableSsh: false
* ```
*
* ### Workstation Config Container
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.Network("default", {
* name: "workstation-cluster",
* autoCreateSubnetworks: false,
* });
* const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
* name: "workstation-cluster",
* ipCidrRange: "10.0.0.0/24",
* region: "us-central1",
* network: _default.name,
* });
* const defaultWorkstationCluster = new gcp.workstations.WorkstationCluster("default", {
* workstationClusterId: "workstation-cluster",
* network: _default.id,
* subnetwork: defaultSubnetwork.id,
* location: "us-central1",
* labels: {
* label: "key",
* },
* annotations: {
* "label-one": "value-one",
* },
* });
* const defaultWorkstationConfig = new gcp.workstations.WorkstationConfig("default", {
* workstationConfigId: "workstation-config",
* workstationClusterId: defaultWorkstationCluster.workstationClusterId,
* location: "us-central1",
* host: {
* gceInstance: {
* machineType: "n1-standard-4",
* bootDiskSizeGb: 35,
* disablePublicIpAddresses: true,
* enableNestedVirtualization: true,
* },
* },
* container: {
* image: "intellij",
* env: {
* NAME: "FOO",
* BABE: "bar",
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.Network("default",
* name="workstation-cluster",
* auto_create_subnetworks=False)
* default_subnetwork = gcp.compute.Subnetwork("default",
* name="workstation-cluster",
* ip_cidr_range="10.0.0.0/24",
* region="us-central1",
* network=default.name)
* default_workstation_cluster = gcp.workstations.WorkstationCluster("default",
* workstation_cluster_id="workstation-cluster",
* network=default.id,
* subnetwork=default_subnetwork.id,
* location="us-central1",
* labels={
* "label": "key",
* },
* annotations={
* "label-one": "value-one",
* })
* default_workstation_config = gcp.workstations.WorkstationConfig("default",
* workstation_config_id="workstation-config",
* workstation_cluster_id=default_workstation_cluster.workstation_cluster_id,
* location="us-central1",
* host=gcp.workstations.WorkstationConfigHostArgs(
* gce_instance=gcp.workstations.WorkstationConfigHostGceInstanceArgs(
* machine_type="n1-standard-4",
* boot_disk_size_gb=35,
* disable_public_ip_addresses=True,
* enable_nested_virtualization=True,
* ),
* ),
* container=gcp.workstations.WorkstationConfigContainerArgs(
* image="intellij",
* env={
* "NAME": "FOO",
* "BABE": "bar",
* },
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.Network("default", new()
* {
* Name = "workstation-cluster",
* AutoCreateSubnetworks = false,
* });
* var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
* {
* Name = "workstation-cluster",
* IpCidrRange = "10.0.0.0/24",
* Region = "us-central1",
* Network = @default.Name,
* });
* var defaultWorkstationCluster = new Gcp.Workstations.WorkstationCluster("default", new()
* {
* WorkstationClusterId = "workstation-cluster",
* Network = @default.Id,
* Subnetwork = defaultSubnetwork.Id,
* Location = "us-central1",
* Labels =
* {
* { "label", "key" },
* },
* Annotations =
* {
* { "label-one", "value-one" },
* },
* });
* var defaultWorkstationConfig = new Gcp.Workstations.WorkstationConfig("default", new()
* {
* WorkstationConfigId = "workstation-config",
* WorkstationClusterId = defaultWorkstationCluster.WorkstationClusterId,
* Location = "us-central1",
* Host = new Gcp.Workstations.Inputs.WorkstationConfigHostArgs
* {
* GceInstance = new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceArgs
* {
* MachineType = "n1-standard-4",
* BootDiskSizeGb = 35,
* DisablePublicIpAddresses = true,
* EnableNestedVirtualization = true,
* },
* },
* Container = new Gcp.Workstations.Inputs.WorkstationConfigContainerArgs
* {
* Image = "intellij",
* Env =
* {
* { "NAME", "FOO" },
* { "BABE", "bar" },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workstations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* IpCidrRange: pulumi.String("10.0.0.0/24"),
* Region: pulumi.String("us-central1"),
* Network: _default.Name,
* })
* if err != nil {
* return err
* }
* defaultWorkstationCluster, err := workstations.NewWorkstationCluster(ctx, "default", &workstations.WorkstationClusterArgs{
* WorkstationClusterId: pulumi.String("workstation-cluster"),
* Network: _default.ID(),
* Subnetwork: defaultSubnetwork.ID(),
* Location: pulumi.String("us-central1"),
* Labels: pulumi.StringMap{
* "label": pulumi.String("key"),
* },
* Annotations: pulumi.StringMap{
* "label-one": pulumi.String("value-one"),
* },
* })
* if err != nil {
* return err
* }
* _, err = workstations.NewWorkstationConfig(ctx, "default", &workstations.WorkstationConfigArgs{
* WorkstationConfigId: pulumi.String("workstation-config"),
* WorkstationClusterId: defaultWorkstationCluster.WorkstationClusterId,
* Location: pulumi.String("us-central1"),
* Host: &workstations.WorkstationConfigHostArgs{
* GceInstance: &workstations.WorkstationConfigHostGceInstanceArgs{
* MachineType: pulumi.String("n1-standard-4"),
* BootDiskSizeGb: pulumi.Int(35),
* DisablePublicIpAddresses: pulumi.Bool(true),
* EnableNestedVirtualization: pulumi.Bool(true),
* },
* },
* Container: &workstations.WorkstationConfigContainerArgs{
* Image: pulumi.String("intellij"),
* Env: pulumi.StringMap{
* "NAME": pulumi.String("FOO"),
* "BABE": pulumi.String("bar"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.workstations.WorkstationCluster;
* import com.pulumi.gcp.workstations.WorkstationClusterArgs;
* import com.pulumi.gcp.workstations.WorkstationConfig;
* import com.pulumi.gcp.workstations.WorkstationConfigArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostGceInstanceArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigContainerArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var default_ = new Network("default", NetworkArgs.builder()
* .name("workstation-cluster")
* .autoCreateSubnetworks(false)
* .build());
* var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
* .name("workstation-cluster")
* .ipCidrRange("10.0.0.0/24")
* .region("us-central1")
* .network(default_.name())
* .build());
* var defaultWorkstationCluster = new WorkstationCluster("defaultWorkstationCluster", WorkstationClusterArgs.builder()
* .workstationClusterId("workstation-cluster")
* .network(default_.id())
* .subnetwork(defaultSubnetwork.id())
* .location("us-central1")
* .labels(Map.of("label", "key"))
* .annotations(Map.of("label-one", "value-one"))
* .build());
* var defaultWorkstationConfig = new WorkstationConfig("defaultWorkstationConfig", WorkstationConfigArgs.builder()
* .workstationConfigId("workstation-config")
* .workstationClusterId(defaultWorkstationCluster.workstationClusterId())
* .location("us-central1")
* .host(WorkstationConfigHostArgs.builder()
* .gceInstance(WorkstationConfigHostGceInstanceArgs.builder()
* .machineType("n1-standard-4")
* .bootDiskSizeGb(35)
* .disablePublicIpAddresses(true)
* .enableNestedVirtualization(true)
* .build())
* .build())
* .container(WorkstationConfigContainerArgs.builder()
* .image("intellij")
* .env(Map.ofEntries(
* Map.entry("NAME", "FOO"),
* Map.entry("BABE", "bar")
* ))
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Network
* properties:
* name: workstation-cluster
* autoCreateSubnetworks: false
* defaultSubnetwork:
* type: gcp:compute:Subnetwork
* name: default
* properties:
* name: workstation-cluster
* ipCidrRange: 10.0.0.0/24
* region: us-central1
* network: ${default.name}
* defaultWorkstationCluster:
* type: gcp:workstations:WorkstationCluster
* name: default
* properties:
* workstationClusterId: workstation-cluster
* network: ${default.id}
* subnetwork: ${defaultSubnetwork.id}
* location: us-central1
* labels:
* label: key
* annotations:
* label-one: value-one
* defaultWorkstationConfig:
* type: gcp:workstations:WorkstationConfig
* name: default
* properties:
* workstationConfigId: workstation-config
* workstationClusterId: ${defaultWorkstationCluster.workstationClusterId}
* location: us-central1
* host:
* gceInstance:
* machineType: n1-standard-4
* bootDiskSizeGb: 35
* disablePublicIpAddresses: true
* enableNestedVirtualization: true
* container:
* image: intellij
* env:
* NAME: FOO
* BABE: bar
* ```
*
* ### Workstation Config Persistent Directories
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.Network("default", {
* name: "workstation-cluster",
* autoCreateSubnetworks: false,
* });
* const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
* name: "workstation-cluster",
* ipCidrRange: "10.0.0.0/24",
* region: "us-central1",
* network: _default.name,
* });
* const defaultWorkstationCluster = new gcp.workstations.WorkstationCluster("default", {
* workstationClusterId: "workstation-cluster",
* network: _default.id,
* subnetwork: defaultSubnetwork.id,
* location: "us-central1",
* labels: {
* label: "key",
* },
* annotations: {
* "label-one": "value-one",
* },
* });
* const defaultWorkstationConfig = new gcp.workstations.WorkstationConfig("default", {
* workstationConfigId: "workstation-config",
* workstationClusterId: defaultWorkstationCluster.workstationClusterId,
* location: "us-central1",
* host: {
* gceInstance: {
* machineType: "e2-standard-4",
* bootDiskSizeGb: 35,
* disablePublicIpAddresses: true,
* shieldedInstanceConfig: {
* enableSecureBoot: true,
* enableVtpm: true,
* },
* },
* },
* persistentDirectories: [{
* mountPath: "/home",
* gcePd: {
* sizeGb: 200,
* fsType: "ext4",
* diskType: "pd-standard",
* reclaimPolicy: "DELETE",
* },
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.Network("default",
* name="workstation-cluster",
* auto_create_subnetworks=False)
* default_subnetwork = gcp.compute.Subnetwork("default",
* name="workstation-cluster",
* ip_cidr_range="10.0.0.0/24",
* region="us-central1",
* network=default.name)
* default_workstation_cluster = gcp.workstations.WorkstationCluster("default",
* workstation_cluster_id="workstation-cluster",
* network=default.id,
* subnetwork=default_subnetwork.id,
* location="us-central1",
* labels={
* "label": "key",
* },
* annotations={
* "label-one": "value-one",
* })
* default_workstation_config = gcp.workstations.WorkstationConfig("default",
* workstation_config_id="workstation-config",
* workstation_cluster_id=default_workstation_cluster.workstation_cluster_id,
* location="us-central1",
* host=gcp.workstations.WorkstationConfigHostArgs(
* gce_instance=gcp.workstations.WorkstationConfigHostGceInstanceArgs(
* machine_type="e2-standard-4",
* boot_disk_size_gb=35,
* disable_public_ip_addresses=True,
* shielded_instance_config=gcp.workstations.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs(
* enable_secure_boot=True,
* enable_vtpm=True,
* ),
* ),
* ),
* persistent_directories=[gcp.workstations.WorkstationConfigPersistentDirectoryArgs(
* mount_path="/home",
* gce_pd=gcp.workstations.WorkstationConfigPersistentDirectoryGcePdArgs(
* size_gb=200,
* fs_type="ext4",
* disk_type="pd-standard",
* reclaim_policy="DELETE",
* ),
* )])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.Network("default", new()
* {
* Name = "workstation-cluster",
* AutoCreateSubnetworks = false,
* });
* var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
* {
* Name = "workstation-cluster",
* IpCidrRange = "10.0.0.0/24",
* Region = "us-central1",
* Network = @default.Name,
* });
* var defaultWorkstationCluster = new Gcp.Workstations.WorkstationCluster("default", new()
* {
* WorkstationClusterId = "workstation-cluster",
* Network = @default.Id,
* Subnetwork = defaultSubnetwork.Id,
* Location = "us-central1",
* Labels =
* {
* { "label", "key" },
* },
* Annotations =
* {
* { "label-one", "value-one" },
* },
* });
* var defaultWorkstationConfig = new Gcp.Workstations.WorkstationConfig("default", new()
* {
* WorkstationConfigId = "workstation-config",
* WorkstationClusterId = defaultWorkstationCluster.WorkstationClusterId,
* Location = "us-central1",
* Host = new Gcp.Workstations.Inputs.WorkstationConfigHostArgs
* {
* GceInstance = new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceArgs
* {
* MachineType = "e2-standard-4",
* BootDiskSizeGb = 35,
* DisablePublicIpAddresses = true,
* ShieldedInstanceConfig = new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs
* {
* EnableSecureBoot = true,
* EnableVtpm = true,
* },
* },
* },
* PersistentDirectories = new[]
* {
* new Gcp.Workstations.Inputs.WorkstationConfigPersistentDirectoryArgs
* {
* MountPath = "/home",
* GcePd = new Gcp.Workstations.Inputs.WorkstationConfigPersistentDirectoryGcePdArgs
* {
* SizeGb = 200,
* FsType = "ext4",
* DiskType = "pd-standard",
* ReclaimPolicy = "DELETE",
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workstations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* IpCidrRange: pulumi.String("10.0.0.0/24"),
* Region: pulumi.String("us-central1"),
* Network: _default.Name,
* })
* if err != nil {
* return err
* }
* defaultWorkstationCluster, err := workstations.NewWorkstationCluster(ctx, "default", &workstations.WorkstationClusterArgs{
* WorkstationClusterId: pulumi.String("workstation-cluster"),
* Network: _default.ID(),
* Subnetwork: defaultSubnetwork.ID(),
* Location: pulumi.String("us-central1"),
* Labels: pulumi.StringMap{
* "label": pulumi.String("key"),
* },
* Annotations: pulumi.StringMap{
* "label-one": pulumi.String("value-one"),
* },
* })
* if err != nil {
* return err
* }
* _, err = workstations.NewWorkstationConfig(ctx, "default", &workstations.WorkstationConfigArgs{
* WorkstationConfigId: pulumi.String("workstation-config"),
* WorkstationClusterId: defaultWorkstationCluster.WorkstationClusterId,
* Location: pulumi.String("us-central1"),
* Host: &workstations.WorkstationConfigHostArgs{
* GceInstance: &workstations.WorkstationConfigHostGceInstanceArgs{
* MachineType: pulumi.String("e2-standard-4"),
* BootDiskSizeGb: pulumi.Int(35),
* DisablePublicIpAddresses: pulumi.Bool(true),
* ShieldedInstanceConfig: &workstations.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs{
* EnableSecureBoot: pulumi.Bool(true),
* EnableVtpm: pulumi.Bool(true),
* },
* },
* },
* PersistentDirectories: workstations.WorkstationConfigPersistentDirectoryArray{
* &workstations.WorkstationConfigPersistentDirectoryArgs{
* MountPath: pulumi.String("/home"),
* GcePd: &workstations.WorkstationConfigPersistentDirectoryGcePdArgs{
* SizeGb: pulumi.Int(200),
* FsType: pulumi.String("ext4"),
* DiskType: pulumi.String("pd-standard"),
* ReclaimPolicy: pulumi.String("DELETE"),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.workstations.WorkstationCluster;
* import com.pulumi.gcp.workstations.WorkstationClusterArgs;
* import com.pulumi.gcp.workstations.WorkstationConfig;
* import com.pulumi.gcp.workstations.WorkstationConfigArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostGceInstanceArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigPersistentDirectoryArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigPersistentDirectoryGcePdArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var default_ = new Network("default", NetworkArgs.builder()
* .name("workstation-cluster")
* .autoCreateSubnetworks(false)
* .build());
* var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
* .name("workstation-cluster")
* .ipCidrRange("10.0.0.0/24")
* .region("us-central1")
* .network(default_.name())
* .build());
* var defaultWorkstationCluster = new WorkstationCluster("defaultWorkstationCluster", WorkstationClusterArgs.builder()
* .workstationClusterId("workstation-cluster")
* .network(default_.id())
* .subnetwork(defaultSubnetwork.id())
* .location("us-central1")
* .labels(Map.of("label", "key"))
* .annotations(Map.of("label-one", "value-one"))
* .build());
* var defaultWorkstationConfig = new WorkstationConfig("defaultWorkstationConfig", WorkstationConfigArgs.builder()
* .workstationConfigId("workstation-config")
* .workstationClusterId(defaultWorkstationCluster.workstationClusterId())
* .location("us-central1")
* .host(WorkstationConfigHostArgs.builder()
* .gceInstance(WorkstationConfigHostGceInstanceArgs.builder()
* .machineType("e2-standard-4")
* .bootDiskSizeGb(35)
* .disablePublicIpAddresses(true)
* .shieldedInstanceConfig(WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs.builder()
* .enableSecureBoot(true)
* .enableVtpm(true)
* .build())
* .build())
* .build())
* .persistentDirectories(WorkstationConfigPersistentDirectoryArgs.builder()
* .mountPath("/home")
* .gcePd(WorkstationConfigPersistentDirectoryGcePdArgs.builder()
* .sizeGb(200)
* .fsType("ext4")
* .diskType("pd-standard")
* .reclaimPolicy("DELETE")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Network
* properties:
* name: workstation-cluster
* autoCreateSubnetworks: false
* defaultSubnetwork:
* type: gcp:compute:Subnetwork
* name: default
* properties:
* name: workstation-cluster
* ipCidrRange: 10.0.0.0/24
* region: us-central1
* network: ${default.name}
* defaultWorkstationCluster:
* type: gcp:workstations:WorkstationCluster
* name: default
* properties:
* workstationClusterId: workstation-cluster
* network: ${default.id}
* subnetwork: ${defaultSubnetwork.id}
* location: us-central1
* labels:
* label: key
* annotations:
* label-one: value-one
* defaultWorkstationConfig:
* type: gcp:workstations:WorkstationConfig
* name: default
* properties:
* workstationConfigId: workstation-config
* workstationClusterId: ${defaultWorkstationCluster.workstationClusterId}
* location: us-central1
* host:
* gceInstance:
* machineType: e2-standard-4
* bootDiskSizeGb: 35
* disablePublicIpAddresses: true
* shieldedInstanceConfig:
* enableSecureBoot: true
* enableVtpm: true
* persistentDirectories:
* - mountPath: /home
* gcePd:
* sizeGb: 200
* fsType: ext4
* diskType: pd-standard
* reclaimPolicy: DELETE
* ```
*
* ### Workstation Config Source Snapshot
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.Network("default", {
* name: "workstation-cluster",
* autoCreateSubnetworks: false,
* });
* const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
* name: "workstation-cluster",
* ipCidrRange: "10.0.0.0/24",
* region: "us-central1",
* network: _default.name,
* });
* const mySourceDisk = new gcp.compute.Disk("my_source_disk", {
* name: "workstation-config",
* size: 10,
* type: "pd-ssd",
* zone: "us-central1-a",
* });
* const mySourceSnapshot = new gcp.compute.Snapshot("my_source_snapshot", {
* name: "workstation-config",
* sourceDisk: mySourceDisk.name,
* zone: "us-central1-a",
* });
* const defaultWorkstationCluster = new gcp.workstations.WorkstationCluster("default", {
* workstationClusterId: "workstation-cluster",
* network: _default.id,
* subnetwork: defaultSubnetwork.id,
* location: "us-central1",
* });
* const defaultWorkstationConfig = new gcp.workstations.WorkstationConfig("default", {
* workstationConfigId: "workstation-config",
* workstationClusterId: defaultWorkstationCluster.workstationClusterId,
* location: defaultWorkstationCluster.location,
* persistentDirectories: [{
* mountPath: "/home",
* gcePd: {
* sourceSnapshot: mySourceSnapshot.id,
* reclaimPolicy: "DELETE",
* },
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.Network("default",
* name="workstation-cluster",
* auto_create_subnetworks=False)
* default_subnetwork = gcp.compute.Subnetwork("default",
* name="workstation-cluster",
* ip_cidr_range="10.0.0.0/24",
* region="us-central1",
* network=default.name)
* my_source_disk = gcp.compute.Disk("my_source_disk",
* name="workstation-config",
* size=10,
* type="pd-ssd",
* zone="us-central1-a")
* my_source_snapshot = gcp.compute.Snapshot("my_source_snapshot",
* name="workstation-config",
* source_disk=my_source_disk.name,
* zone="us-central1-a")
* default_workstation_cluster = gcp.workstations.WorkstationCluster("default",
* workstation_cluster_id="workstation-cluster",
* network=default.id,
* subnetwork=default_subnetwork.id,
* location="us-central1")
* default_workstation_config = gcp.workstations.WorkstationConfig("default",
* workstation_config_id="workstation-config",
* workstation_cluster_id=default_workstation_cluster.workstation_cluster_id,
* location=default_workstation_cluster.location,
* persistent_directories=[gcp.workstations.WorkstationConfigPersistentDirectoryArgs(
* mount_path="/home",
* gce_pd=gcp.workstations.WorkstationConfigPersistentDirectoryGcePdArgs(
* source_snapshot=my_source_snapshot.id,
* reclaim_policy="DELETE",
* ),
* )])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.Network("default", new()
* {
* Name = "workstation-cluster",
* AutoCreateSubnetworks = false,
* });
* var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
* {
* Name = "workstation-cluster",
* IpCidrRange = "10.0.0.0/24",
* Region = "us-central1",
* Network = @default.Name,
* });
* var mySourceDisk = new Gcp.Compute.Disk("my_source_disk", new()
* {
* Name = "workstation-config",
* Size = 10,
* Type = "pd-ssd",
* Zone = "us-central1-a",
* });
* var mySourceSnapshot = new Gcp.Compute.Snapshot("my_source_snapshot", new()
* {
* Name = "workstation-config",
* SourceDisk = mySourceDisk.Name,
* Zone = "us-central1-a",
* });
* var defaultWorkstationCluster = new Gcp.Workstations.WorkstationCluster("default", new()
* {
* WorkstationClusterId = "workstation-cluster",
* Network = @default.Id,
* Subnetwork = defaultSubnetwork.Id,
* Location = "us-central1",
* });
* var defaultWorkstationConfig = new Gcp.Workstations.WorkstationConfig("default", new()
* {
* WorkstationConfigId = "workstation-config",
* WorkstationClusterId = defaultWorkstationCluster.WorkstationClusterId,
* Location = defaultWorkstationCluster.Location,
* PersistentDirectories = new[]
* {
* new Gcp.Workstations.Inputs.WorkstationConfigPersistentDirectoryArgs
* {
* MountPath = "/home",
* GcePd = new Gcp.Workstations.Inputs.WorkstationConfigPersistentDirectoryGcePdArgs
* {
* SourceSnapshot = mySourceSnapshot.Id,
* ReclaimPolicy = "DELETE",
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workstations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* IpCidrRange: pulumi.String("10.0.0.0/24"),
* Region: pulumi.String("us-central1"),
* Network: _default.Name,
* })
* if err != nil {
* return err
* }
* mySourceDisk, err := compute.NewDisk(ctx, "my_source_disk", &compute.DiskArgs{
* Name: pulumi.String("workstation-config"),
* Size: pulumi.Int(10),
* Type: pulumi.String("pd-ssd"),
* Zone: pulumi.String("us-central1-a"),
* })
* if err != nil {
* return err
* }
* mySourceSnapshot, err := compute.NewSnapshot(ctx, "my_source_snapshot", &compute.SnapshotArgs{
* Name: pulumi.String("workstation-config"),
* SourceDisk: mySourceDisk.Name,
* Zone: pulumi.String("us-central1-a"),
* })
* if err != nil {
* return err
* }
* defaultWorkstationCluster, err := workstations.NewWorkstationCluster(ctx, "default", &workstations.WorkstationClusterArgs{
* WorkstationClusterId: pulumi.String("workstation-cluster"),
* Network: _default.ID(),
* Subnetwork: defaultSubnetwork.ID(),
* Location: pulumi.String("us-central1"),
* })
* if err != nil {
* return err
* }
* _, err = workstations.NewWorkstationConfig(ctx, "default", &workstations.WorkstationConfigArgs{
* WorkstationConfigId: pulumi.String("workstation-config"),
* WorkstationClusterId: defaultWorkstationCluster.WorkstationClusterId,
* Location: defaultWorkstationCluster.Location,
* PersistentDirectories: workstations.WorkstationConfigPersistentDirectoryArray{
* &workstations.WorkstationConfigPersistentDirectoryArgs{
* MountPath: pulumi.String("/home"),
* GcePd: &workstations.WorkstationConfigPersistentDirectoryGcePdArgs{
* SourceSnapshot: mySourceSnapshot.ID(),
* ReclaimPolicy: pulumi.String("DELETE"),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.compute.Disk;
* import com.pulumi.gcp.compute.DiskArgs;
* import com.pulumi.gcp.compute.Snapshot;
* import com.pulumi.gcp.compute.SnapshotArgs;
* import com.pulumi.gcp.workstations.WorkstationCluster;
* import com.pulumi.gcp.workstations.WorkstationClusterArgs;
* import com.pulumi.gcp.workstations.WorkstationConfig;
* import com.pulumi.gcp.workstations.WorkstationConfigArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigPersistentDirectoryArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigPersistentDirectoryGcePdArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var default_ = new Network("default", NetworkArgs.builder()
* .name("workstation-cluster")
* .autoCreateSubnetworks(false)
* .build());
* var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
* .name("workstation-cluster")
* .ipCidrRange("10.0.0.0/24")
* .region("us-central1")
* .network(default_.name())
* .build());
* var mySourceDisk = new Disk("mySourceDisk", DiskArgs.builder()
* .name("workstation-config")
* .size(10)
* .type("pd-ssd")
* .zone("us-central1-a")
* .build());
* var mySourceSnapshot = new Snapshot("mySourceSnapshot", SnapshotArgs.builder()
* .name("workstation-config")
* .sourceDisk(mySourceDisk.name())
* .zone("us-central1-a")
* .build());
* var defaultWorkstationCluster = new WorkstationCluster("defaultWorkstationCluster", WorkstationClusterArgs.builder()
* .workstationClusterId("workstation-cluster")
* .network(default_.id())
* .subnetwork(defaultSubnetwork.id())
* .location("us-central1")
* .build());
* var defaultWorkstationConfig = new WorkstationConfig("defaultWorkstationConfig", WorkstationConfigArgs.builder()
* .workstationConfigId("workstation-config")
* .workstationClusterId(defaultWorkstationCluster.workstationClusterId())
* .location(defaultWorkstationCluster.location())
* .persistentDirectories(WorkstationConfigPersistentDirectoryArgs.builder()
* .mountPath("/home")
* .gcePd(WorkstationConfigPersistentDirectoryGcePdArgs.builder()
* .sourceSnapshot(mySourceSnapshot.id())
* .reclaimPolicy("DELETE")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Network
* properties:
* name: workstation-cluster
* autoCreateSubnetworks: false
* defaultSubnetwork:
* type: gcp:compute:Subnetwork
* name: default
* properties:
* name: workstation-cluster
* ipCidrRange: 10.0.0.0/24
* region: us-central1
* network: ${default.name}
* mySourceDisk:
* type: gcp:compute:Disk
* name: my_source_disk
* properties:
* name: workstation-config
* size: 10
* type: pd-ssd
* zone: us-central1-a
* mySourceSnapshot:
* type: gcp:compute:Snapshot
* name: my_source_snapshot
* properties:
* name: workstation-config
* sourceDisk: ${mySourceDisk.name}
* zone: us-central1-a
* defaultWorkstationCluster:
* type: gcp:workstations:WorkstationCluster
* name: default
* properties:
* workstationClusterId: workstation-cluster
* network: ${default.id}
* subnetwork: ${defaultSubnetwork.id}
* location: us-central1
* defaultWorkstationConfig:
* type: gcp:workstations:WorkstationConfig
* name: default
* properties:
* workstationConfigId: workstation-config
* workstationClusterId: ${defaultWorkstationCluster.workstationClusterId}
* location: ${defaultWorkstationCluster.location}
* persistentDirectories:
* - mountPath: /home
* gcePd:
* sourceSnapshot: ${mySourceSnapshot.id}
* reclaimPolicy: DELETE
* ```
*
* ### Workstation Config Shielded Instance Config
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.Network("default", {
* name: "workstation-cluster",
* autoCreateSubnetworks: false,
* });
* const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
* name: "workstation-cluster",
* ipCidrRange: "10.0.0.0/24",
* region: "us-central1",
* network: _default.name,
* });
* const defaultWorkstationCluster = new gcp.workstations.WorkstationCluster("default", {
* workstationClusterId: "workstation-cluster",
* network: _default.id,
* subnetwork: defaultSubnetwork.id,
* location: "us-central1",
* labels: {
* label: "key",
* },
* annotations: {
* "label-one": "value-one",
* },
* });
* const defaultWorkstationConfig = new gcp.workstations.WorkstationConfig("default", {
* workstationConfigId: "workstation-config",
* workstationClusterId: defaultWorkstationCluster.workstationClusterId,
* location: "us-central1",
* host: {
* gceInstance: {
* machineType: "e2-standard-4",
* bootDiskSizeGb: 35,
* disablePublicIpAddresses: true,
* shieldedInstanceConfig: {
* enableSecureBoot: true,
* enableVtpm: true,
* },
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.Network("default",
* name="workstation-cluster",
* auto_create_subnetworks=False)
* default_subnetwork = gcp.compute.Subnetwork("default",
* name="workstation-cluster",
* ip_cidr_range="10.0.0.0/24",
* region="us-central1",
* network=default.name)
* default_workstation_cluster = gcp.workstations.WorkstationCluster("default",
* workstation_cluster_id="workstation-cluster",
* network=default.id,
* subnetwork=default_subnetwork.id,
* location="us-central1",
* labels={
* "label": "key",
* },
* annotations={
* "label-one": "value-one",
* })
* default_workstation_config = gcp.workstations.WorkstationConfig("default",
* workstation_config_id="workstation-config",
* workstation_cluster_id=default_workstation_cluster.workstation_cluster_id,
* location="us-central1",
* host=gcp.workstations.WorkstationConfigHostArgs(
* gce_instance=gcp.workstations.WorkstationConfigHostGceInstanceArgs(
* machine_type="e2-standard-4",
* boot_disk_size_gb=35,
* disable_public_ip_addresses=True,
* shielded_instance_config=gcp.workstations.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs(
* enable_secure_boot=True,
* enable_vtpm=True,
* ),
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.Network("default", new()
* {
* Name = "workstation-cluster",
* AutoCreateSubnetworks = false,
* });
* var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
* {
* Name = "workstation-cluster",
* IpCidrRange = "10.0.0.0/24",
* Region = "us-central1",
* Network = @default.Name,
* });
* var defaultWorkstationCluster = new Gcp.Workstations.WorkstationCluster("default", new()
* {
* WorkstationClusterId = "workstation-cluster",
* Network = @default.Id,
* Subnetwork = defaultSubnetwork.Id,
* Location = "us-central1",
* Labels =
* {
* { "label", "key" },
* },
* Annotations =
* {
* { "label-one", "value-one" },
* },
* });
* var defaultWorkstationConfig = new Gcp.Workstations.WorkstationConfig("default", new()
* {
* WorkstationConfigId = "workstation-config",
* WorkstationClusterId = defaultWorkstationCluster.WorkstationClusterId,
* Location = "us-central1",
* Host = new Gcp.Workstations.Inputs.WorkstationConfigHostArgs
* {
* GceInstance = new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceArgs
* {
* MachineType = "e2-standard-4",
* BootDiskSizeGb = 35,
* DisablePublicIpAddresses = true,
* ShieldedInstanceConfig = new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs
* {
* EnableSecureBoot = true,
* EnableVtpm = true,
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workstations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* IpCidrRange: pulumi.String("10.0.0.0/24"),
* Region: pulumi.String("us-central1"),
* Network: _default.Name,
* })
* if err != nil {
* return err
* }
* defaultWorkstationCluster, err := workstations.NewWorkstationCluster(ctx, "default", &workstations.WorkstationClusterArgs{
* WorkstationClusterId: pulumi.String("workstation-cluster"),
* Network: _default.ID(),
* Subnetwork: defaultSubnetwork.ID(),
* Location: pulumi.String("us-central1"),
* Labels: pulumi.StringMap{
* "label": pulumi.String("key"),
* },
* Annotations: pulumi.StringMap{
* "label-one": pulumi.String("value-one"),
* },
* })
* if err != nil {
* return err
* }
* _, err = workstations.NewWorkstationConfig(ctx, "default", &workstations.WorkstationConfigArgs{
* WorkstationConfigId: pulumi.String("workstation-config"),
* WorkstationClusterId: defaultWorkstationCluster.WorkstationClusterId,
* Location: pulumi.String("us-central1"),
* Host: &workstations.WorkstationConfigHostArgs{
* GceInstance: &workstations.WorkstationConfigHostGceInstanceArgs{
* MachineType: pulumi.String("e2-standard-4"),
* BootDiskSizeGb: pulumi.Int(35),
* DisablePublicIpAddresses: pulumi.Bool(true),
* ShieldedInstanceConfig: &workstations.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs{
* EnableSecureBoot: pulumi.Bool(true),
* EnableVtpm: pulumi.Bool(true),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.workstations.WorkstationCluster;
* import com.pulumi.gcp.workstations.WorkstationClusterArgs;
* import com.pulumi.gcp.workstations.WorkstationConfig;
* import com.pulumi.gcp.workstations.WorkstationConfigArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostGceInstanceArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var default_ = new Network("default", NetworkArgs.builder()
* .name("workstation-cluster")
* .autoCreateSubnetworks(false)
* .build());
* var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
* .name("workstation-cluster")
* .ipCidrRange("10.0.0.0/24")
* .region("us-central1")
* .network(default_.name())
* .build());
* var defaultWorkstationCluster = new WorkstationCluster("defaultWorkstationCluster", WorkstationClusterArgs.builder()
* .workstationClusterId("workstation-cluster")
* .network(default_.id())
* .subnetwork(defaultSubnetwork.id())
* .location("us-central1")
* .labels(Map.of("label", "key"))
* .annotations(Map.of("label-one", "value-one"))
* .build());
* var defaultWorkstationConfig = new WorkstationConfig("defaultWorkstationConfig", WorkstationConfigArgs.builder()
* .workstationConfigId("workstation-config")
* .workstationClusterId(defaultWorkstationCluster.workstationClusterId())
* .location("us-central1")
* .host(WorkstationConfigHostArgs.builder()
* .gceInstance(WorkstationConfigHostGceInstanceArgs.builder()
* .machineType("e2-standard-4")
* .bootDiskSizeGb(35)
* .disablePublicIpAddresses(true)
* .shieldedInstanceConfig(WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs.builder()
* .enableSecureBoot(true)
* .enableVtpm(true)
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Network
* properties:
* name: workstation-cluster
* autoCreateSubnetworks: false
* defaultSubnetwork:
* type: gcp:compute:Subnetwork
* name: default
* properties:
* name: workstation-cluster
* ipCidrRange: 10.0.0.0/24
* region: us-central1
* network: ${default.name}
* defaultWorkstationCluster:
* type: gcp:workstations:WorkstationCluster
* name: default
* properties:
* workstationClusterId: workstation-cluster
* network: ${default.id}
* subnetwork: ${defaultSubnetwork.id}
* location: us-central1
* labels:
* label: key
* annotations:
* label-one: value-one
* defaultWorkstationConfig:
* type: gcp:workstations:WorkstationConfig
* name: default
* properties:
* workstationConfigId: workstation-config
* workstationClusterId: ${defaultWorkstationCluster.workstationClusterId}
* location: us-central1
* host:
* gceInstance:
* machineType: e2-standard-4
* bootDiskSizeGb: 35
* disablePublicIpAddresses: true
* shieldedInstanceConfig:
* enableSecureBoot: true
* enableVtpm: true
* ```
*
* ### Workstation Config Accelerators
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.Network("default", {
* name: "workstation-cluster",
* autoCreateSubnetworks: false,
* });
* const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
* name: "workstation-cluster",
* ipCidrRange: "10.0.0.0/24",
* region: "us-central1",
* network: _default.name,
* });
* const defaultWorkstationCluster = new gcp.workstations.WorkstationCluster("default", {
* workstationClusterId: "workstation-cluster",
* network: _default.id,
* subnetwork: defaultSubnetwork.id,
* location: "us-central1",
* labels: {
* label: "key",
* },
* annotations: {
* "label-one": "value-one",
* },
* });
* const defaultWorkstationConfig = new gcp.workstations.WorkstationConfig("default", {
* workstationConfigId: "workstation-config",
* workstationClusterId: defaultWorkstationCluster.workstationClusterId,
* location: "us-central1",
* host: {
* gceInstance: {
* machineType: "n1-standard-2",
* bootDiskSizeGb: 35,
* disablePublicIpAddresses: true,
* accelerators: [{
* type: "nvidia-tesla-t4",
* count: 1,
* }],
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.Network("default",
* name="workstation-cluster",
* auto_create_subnetworks=False)
* default_subnetwork = gcp.compute.Subnetwork("default",
* name="workstation-cluster",
* ip_cidr_range="10.0.0.0/24",
* region="us-central1",
* network=default.name)
* default_workstation_cluster = gcp.workstations.WorkstationCluster("default",
* workstation_cluster_id="workstation-cluster",
* network=default.id,
* subnetwork=default_subnetwork.id,
* location="us-central1",
* labels={
* "label": "key",
* },
* annotations={
* "label-one": "value-one",
* })
* default_workstation_config = gcp.workstations.WorkstationConfig("default",
* workstation_config_id="workstation-config",
* workstation_cluster_id=default_workstation_cluster.workstation_cluster_id,
* location="us-central1",
* host=gcp.workstations.WorkstationConfigHostArgs(
* gce_instance=gcp.workstations.WorkstationConfigHostGceInstanceArgs(
* machine_type="n1-standard-2",
* boot_disk_size_gb=35,
* disable_public_ip_addresses=True,
* accelerators=[gcp.workstations.WorkstationConfigHostGceInstanceAcceleratorArgs(
* type="nvidia-tesla-t4",
* count=1,
* )],
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.Network("default", new()
* {
* Name = "workstation-cluster",
* AutoCreateSubnetworks = false,
* });
* var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
* {
* Name = "workstation-cluster",
* IpCidrRange = "10.0.0.0/24",
* Region = "us-central1",
* Network = @default.Name,
* });
* var defaultWorkstationCluster = new Gcp.Workstations.WorkstationCluster("default", new()
* {
* WorkstationClusterId = "workstation-cluster",
* Network = @default.Id,
* Subnetwork = defaultSubnetwork.Id,
* Location = "us-central1",
* Labels =
* {
* { "label", "key" },
* },
* Annotations =
* {
* { "label-one", "value-one" },
* },
* });
* var defaultWorkstationConfig = new Gcp.Workstations.WorkstationConfig("default", new()
* {
* WorkstationConfigId = "workstation-config",
* WorkstationClusterId = defaultWorkstationCluster.WorkstationClusterId,
* Location = "us-central1",
* Host = new Gcp.Workstations.Inputs.WorkstationConfigHostArgs
* {
* GceInstance = new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceArgs
* {
* MachineType = "n1-standard-2",
* BootDiskSizeGb = 35,
* DisablePublicIpAddresses = true,
* Accelerators = new[]
* {
* new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceAcceleratorArgs
* {
* Type = "nvidia-tesla-t4",
* Count = 1,
* },
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workstations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* IpCidrRange: pulumi.String("10.0.0.0/24"),
* Region: pulumi.String("us-central1"),
* Network: _default.Name,
* })
* if err != nil {
* return err
* }
* defaultWorkstationCluster, err := workstations.NewWorkstationCluster(ctx, "default", &workstations.WorkstationClusterArgs{
* WorkstationClusterId: pulumi.String("workstation-cluster"),
* Network: _default.ID(),
* Subnetwork: defaultSubnetwork.ID(),
* Location: pulumi.String("us-central1"),
* Labels: pulumi.StringMap{
* "label": pulumi.String("key"),
* },
* Annotations: pulumi.StringMap{
* "label-one": pulumi.String("value-one"),
* },
* })
* if err != nil {
* return err
* }
* _, err = workstations.NewWorkstationConfig(ctx, "default", &workstations.WorkstationConfigArgs{
* WorkstationConfigId: pulumi.String("workstation-config"),
* WorkstationClusterId: defaultWorkstationCluster.WorkstationClusterId,
* Location: pulumi.String("us-central1"),
* Host: &workstations.WorkstationConfigHostArgs{
* GceInstance: &workstations.WorkstationConfigHostGceInstanceArgs{
* MachineType: pulumi.String("n1-standard-2"),
* BootDiskSizeGb: pulumi.Int(35),
* DisablePublicIpAddresses: pulumi.Bool(true),
* Accelerators: workstations.WorkstationConfigHostGceInstanceAcceleratorArray{
* &workstations.WorkstationConfigHostGceInstanceAcceleratorArgs{
* Type: pulumi.String("nvidia-tesla-t4"),
* Count: pulumi.Int(1),
* },
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.workstations.WorkstationCluster;
* import com.pulumi.gcp.workstations.WorkstationClusterArgs;
* import com.pulumi.gcp.workstations.WorkstationConfig;
* import com.pulumi.gcp.workstations.WorkstationConfigArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostGceInstanceArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var default_ = new Network("default", NetworkArgs.builder()
* .name("workstation-cluster")
* .autoCreateSubnetworks(false)
* .build());
* var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
* .name("workstation-cluster")
* .ipCidrRange("10.0.0.0/24")
* .region("us-central1")
* .network(default_.name())
* .build());
* var defaultWorkstationCluster = new WorkstationCluster("defaultWorkstationCluster", WorkstationClusterArgs.builder()
* .workstationClusterId("workstation-cluster")
* .network(default_.id())
* .subnetwork(defaultSubnetwork.id())
* .location("us-central1")
* .labels(Map.of("label", "key"))
* .annotations(Map.of("label-one", "value-one"))
* .build());
* var defaultWorkstationConfig = new WorkstationConfig("defaultWorkstationConfig", WorkstationConfigArgs.builder()
* .workstationConfigId("workstation-config")
* .workstationClusterId(defaultWorkstationCluster.workstationClusterId())
* .location("us-central1")
* .host(WorkstationConfigHostArgs.builder()
* .gceInstance(WorkstationConfigHostGceInstanceArgs.builder()
* .machineType("n1-standard-2")
* .bootDiskSizeGb(35)
* .disablePublicIpAddresses(true)
* .accelerators(WorkstationConfigHostGceInstanceAcceleratorArgs.builder()
* .type("nvidia-tesla-t4")
* .count("1")
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Network
* properties:
* name: workstation-cluster
* autoCreateSubnetworks: false
* defaultSubnetwork:
* type: gcp:compute:Subnetwork
* name: default
* properties:
* name: workstation-cluster
* ipCidrRange: 10.0.0.0/24
* region: us-central1
* network: ${default.name}
* defaultWorkstationCluster:
* type: gcp:workstations:WorkstationCluster
* name: default
* properties:
* workstationClusterId: workstation-cluster
* network: ${default.id}
* subnetwork: ${defaultSubnetwork.id}
* location: us-central1
* labels:
* label: key
* annotations:
* label-one: value-one
* defaultWorkstationConfig:
* type: gcp:workstations:WorkstationConfig
* name: default
* properties:
* workstationConfigId: workstation-config
* workstationClusterId: ${defaultWorkstationCluster.workstationClusterId}
* location: us-central1
* host:
* gceInstance:
* machineType: n1-standard-2
* bootDiskSizeGb: 35
* disablePublicIpAddresses: true
* accelerators:
* - type: nvidia-tesla-t4
* count: '1'
* ```
*
* ### Workstation Config Boost
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.Network("default", {
* name: "workstation-cluster",
* autoCreateSubnetworks: false,
* });
* const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
* name: "workstation-cluster",
* ipCidrRange: "10.0.0.0/24",
* region: "us-central1",
* network: _default.name,
* });
* const defaultWorkstationCluster = new gcp.workstations.WorkstationCluster("default", {
* workstationClusterId: "workstation-cluster",
* network: _default.id,
* subnetwork: defaultSubnetwork.id,
* location: "us-central1",
* labels: {
* label: "key",
* },
* annotations: {
* "label-one": "value-one",
* },
* });
* const defaultWorkstationConfig = new gcp.workstations.WorkstationConfig("default", {
* workstationConfigId: "workstation-config",
* workstationClusterId: defaultWorkstationCluster.workstationClusterId,
* location: "us-central1",
* host: {
* gceInstance: {
* machineType: "e2-standard-4",
* bootDiskSizeGb: 35,
* disablePublicIpAddresses: true,
* boostConfigs: [
* {
* id: "boost-1",
* machineType: "n1-standard-2",
* accelerators: [{
* type: "nvidia-tesla-t4",
* count: 1,
* }],
* },
* {
* id: "boost-1",
* machineType: "e2-standard-2",
* },
* ],
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.Network("default",
* name="workstation-cluster",
* auto_create_subnetworks=False)
* default_subnetwork = gcp.compute.Subnetwork("default",
* name="workstation-cluster",
* ip_cidr_range="10.0.0.0/24",
* region="us-central1",
* network=default.name)
* default_workstation_cluster = gcp.workstations.WorkstationCluster("default",
* workstation_cluster_id="workstation-cluster",
* network=default.id,
* subnetwork=default_subnetwork.id,
* location="us-central1",
* labels={
* "label": "key",
* },
* annotations={
* "label-one": "value-one",
* })
* default_workstation_config = gcp.workstations.WorkstationConfig("default",
* workstation_config_id="workstation-config",
* workstation_cluster_id=default_workstation_cluster.workstation_cluster_id,
* location="us-central1",
* host=gcp.workstations.WorkstationConfigHostArgs(
* gce_instance=gcp.workstations.WorkstationConfigHostGceInstanceArgs(
* machine_type="e2-standard-4",
* boot_disk_size_gb=35,
* disable_public_ip_addresses=True,
* boost_configs=[
* gcp.workstations.WorkstationConfigHostGceInstanceBoostConfigArgs(
* id="boost-1",
* machine_type="n1-standard-2",
* accelerators=[gcp.workstations.WorkstationConfigHostGceInstanceBoostConfigAcceleratorArgs(
* type="nvidia-tesla-t4",
* count=1,
* )],
* ),
* gcp.workstations.WorkstationConfigHostGceInstanceBoostConfigArgs(
* id="boost-1",
* machine_type="e2-standard-2",
* ),
* ],
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.Network("default", new()
* {
* Name = "workstation-cluster",
* AutoCreateSubnetworks = false,
* });
* var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
* {
* Name = "workstation-cluster",
* IpCidrRange = "10.0.0.0/24",
* Region = "us-central1",
* Network = @default.Name,
* });
* var defaultWorkstationCluster = new Gcp.Workstations.WorkstationCluster("default", new()
* {
* WorkstationClusterId = "workstation-cluster",
* Network = @default.Id,
* Subnetwork = defaultSubnetwork.Id,
* Location = "us-central1",
* Labels =
* {
* { "label", "key" },
* },
* Annotations =
* {
* { "label-one", "value-one" },
* },
* });
* var defaultWorkstationConfig = new Gcp.Workstations.WorkstationConfig("default", new()
* {
* WorkstationConfigId = "workstation-config",
* WorkstationClusterId = defaultWorkstationCluster.WorkstationClusterId,
* Location = "us-central1",
* Host = new Gcp.Workstations.Inputs.WorkstationConfigHostArgs
* {
* GceInstance = new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceArgs
* {
* MachineType = "e2-standard-4",
* BootDiskSizeGb = 35,
* DisablePublicIpAddresses = true,
* BoostConfigs = new[]
* {
* new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceBoostConfigArgs
* {
* Id = "boost-1",
* MachineType = "n1-standard-2",
* Accelerators = new[]
* {
* new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceBoostConfigAcceleratorArgs
* {
* Type = "nvidia-tesla-t4",
* Count = 1,
* },
* },
* },
* new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceBoostConfigArgs
* {
* Id = "boost-1",
* MachineType = "e2-standard-2",
* },
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workstations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* IpCidrRange: pulumi.String("10.0.0.0/24"),
* Region: pulumi.String("us-central1"),
* Network: _default.Name,
* })
* if err != nil {
* return err
* }
* defaultWorkstationCluster, err := workstations.NewWorkstationCluster(ctx, "default", &workstations.WorkstationClusterArgs{
* WorkstationClusterId: pulumi.String("workstation-cluster"),
* Network: _default.ID(),
* Subnetwork: defaultSubnetwork.ID(),
* Location: pulumi.String("us-central1"),
* Labels: pulumi.StringMap{
* "label": pulumi.String("key"),
* },
* Annotations: pulumi.StringMap{
* "label-one": pulumi.String("value-one"),
* },
* })
* if err != nil {
* return err
* }
* _, err = workstations.NewWorkstationConfig(ctx, "default", &workstations.WorkstationConfigArgs{
* WorkstationConfigId: pulumi.String("workstation-config"),
* WorkstationClusterId: defaultWorkstationCluster.WorkstationClusterId,
* Location: pulumi.String("us-central1"),
* Host: &workstations.WorkstationConfigHostArgs{
* GceInstance: &workstations.WorkstationConfigHostGceInstanceArgs{
* MachineType: pulumi.String("e2-standard-4"),
* BootDiskSizeGb: pulumi.Int(35),
* DisablePublicIpAddresses: pulumi.Bool(true),
* BoostConfigs: workstations.WorkstationConfigHostGceInstanceBoostConfigArray{
* &workstations.WorkstationConfigHostGceInstanceBoostConfigArgs{
* Id: pulumi.String("boost-1"),
* MachineType: pulumi.String("n1-standard-2"),
* Accelerators: workstations.WorkstationConfigHostGceInstanceBoostConfigAcceleratorArray{
* &workstations.WorkstationConfigHostGceInstanceBoostConfigAcceleratorArgs{
* Type: pulumi.String("nvidia-tesla-t4"),
* Count: pulumi.Int(1),
* },
* },
* },
* &workstations.WorkstationConfigHostGceInstanceBoostConfigArgs{
* Id: pulumi.String("boost-1"),
* MachineType: pulumi.String("e2-standard-2"),
* },
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.workstations.WorkstationCluster;
* import com.pulumi.gcp.workstations.WorkstationClusterArgs;
* import com.pulumi.gcp.workstations.WorkstationConfig;
* import com.pulumi.gcp.workstations.WorkstationConfigArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostGceInstanceArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var default_ = new Network("default", NetworkArgs.builder()
* .name("workstation-cluster")
* .autoCreateSubnetworks(false)
* .build());
* var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
* .name("workstation-cluster")
* .ipCidrRange("10.0.0.0/24")
* .region("us-central1")
* .network(default_.name())
* .build());
* var defaultWorkstationCluster = new WorkstationCluster("defaultWorkstationCluster", WorkstationClusterArgs.builder()
* .workstationClusterId("workstation-cluster")
* .network(default_.id())
* .subnetwork(defaultSubnetwork.id())
* .location("us-central1")
* .labels(Map.of("label", "key"))
* .annotations(Map.of("label-one", "value-one"))
* .build());
* var defaultWorkstationConfig = new WorkstationConfig("defaultWorkstationConfig", WorkstationConfigArgs.builder()
* .workstationConfigId("workstation-config")
* .workstationClusterId(defaultWorkstationCluster.workstationClusterId())
* .location("us-central1")
* .host(WorkstationConfigHostArgs.builder()
* .gceInstance(WorkstationConfigHostGceInstanceArgs.builder()
* .machineType("e2-standard-4")
* .bootDiskSizeGb(35)
* .disablePublicIpAddresses(true)
* .boostConfigs(
* WorkstationConfigHostGceInstanceBoostConfigArgs.builder()
* .id("boost-1")
* .machineType("n1-standard-2")
* .accelerators(WorkstationConfigHostGceInstanceBoostConfigAcceleratorArgs.builder()
* .type("nvidia-tesla-t4")
* .count("1")
* .build())
* .build(),
* WorkstationConfigHostGceInstanceBoostConfigArgs.builder()
* .id("boost-1")
* .machineType("e2-standard-2")
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Network
* properties:
* name: workstation-cluster
* autoCreateSubnetworks: false
* defaultSubnetwork:
* type: gcp:compute:Subnetwork
* name: default
* properties:
* name: workstation-cluster
* ipCidrRange: 10.0.0.0/24
* region: us-central1
* network: ${default.name}
* defaultWorkstationCluster:
* type: gcp:workstations:WorkstationCluster
* name: default
* properties:
* workstationClusterId: workstation-cluster
* network: ${default.id}
* subnetwork: ${defaultSubnetwork.id}
* location: us-central1
* labels:
* label: key
* annotations:
* label-one: value-one
* defaultWorkstationConfig:
* type: gcp:workstations:WorkstationConfig
* name: default
* properties:
* workstationConfigId: workstation-config
* workstationClusterId: ${defaultWorkstationCluster.workstationClusterId}
* location: us-central1
* host:
* gceInstance:
* machineType: e2-standard-4
* bootDiskSizeGb: 35
* disablePublicIpAddresses: true
* boostConfigs:
* - id: boost-1
* machineType: n1-standard-2
* accelerators:
* - type: nvidia-tesla-t4
* count: '1'
* - id: boost-1
* machineType: e2-standard-2
* ```
*
* ### Workstation Config Encryption Key
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.Network("default", {
* name: "workstation-cluster",
* autoCreateSubnetworks: false,
* });
* const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
* name: "workstation-cluster",
* ipCidrRange: "10.0.0.0/24",
* region: "us-central1",
* network: _default.name,
* });
* const defaultWorkstationCluster = new gcp.workstations.WorkstationCluster("default", {
* workstationClusterId: "workstation-cluster",
* network: _default.id,
* subnetwork: defaultSubnetwork.id,
* location: "us-central1",
* labels: {
* label: "key",
* },
* annotations: {
* "label-one": "value-one",
* },
* });
* const defaultKeyRing = new gcp.kms.KeyRing("default", {
* name: "workstation-cluster",
* location: "us-central1",
* });
* const defaultCryptoKey = new gcp.kms.CryptoKey("default", {
* name: "workstation-cluster",
* keyRing: defaultKeyRing.id,
* });
* const defaultAccount = new gcp.serviceaccount.Account("default", {
* accountId: "my-account",
* displayName: "Service Account",
* });
* const defaultWorkstationConfig = new gcp.workstations.WorkstationConfig("default", {
* workstationConfigId: "workstation-config",
* workstationClusterId: defaultWorkstationCluster.workstationClusterId,
* location: "us-central1",
* host: {
* gceInstance: {
* machineType: "e2-standard-4",
* bootDiskSizeGb: 35,
* disablePublicIpAddresses: true,
* shieldedInstanceConfig: {
* enableSecureBoot: true,
* enableVtpm: true,
* },
* },
* },
* encryptionKey: {
* kmsKey: defaultCryptoKey.id,
* kmsKeyServiceAccount: defaultAccount.email,
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.Network("default",
* name="workstation-cluster",
* auto_create_subnetworks=False)
* default_subnetwork = gcp.compute.Subnetwork("default",
* name="workstation-cluster",
* ip_cidr_range="10.0.0.0/24",
* region="us-central1",
* network=default.name)
* default_workstation_cluster = gcp.workstations.WorkstationCluster("default",
* workstation_cluster_id="workstation-cluster",
* network=default.id,
* subnetwork=default_subnetwork.id,
* location="us-central1",
* labels={
* "label": "key",
* },
* annotations={
* "label-one": "value-one",
* })
* default_key_ring = gcp.kms.KeyRing("default",
* name="workstation-cluster",
* location="us-central1")
* default_crypto_key = gcp.kms.CryptoKey("default",
* name="workstation-cluster",
* key_ring=default_key_ring.id)
* default_account = gcp.serviceaccount.Account("default",
* account_id="my-account",
* display_name="Service Account")
* default_workstation_config = gcp.workstations.WorkstationConfig("default",
* workstation_config_id="workstation-config",
* workstation_cluster_id=default_workstation_cluster.workstation_cluster_id,
* location="us-central1",
* host=gcp.workstations.WorkstationConfigHostArgs(
* gce_instance=gcp.workstations.WorkstationConfigHostGceInstanceArgs(
* machine_type="e2-standard-4",
* boot_disk_size_gb=35,
* disable_public_ip_addresses=True,
* shielded_instance_config=gcp.workstations.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs(
* enable_secure_boot=True,
* enable_vtpm=True,
* ),
* ),
* ),
* encryption_key=gcp.workstations.WorkstationConfigEncryptionKeyArgs(
* kms_key=default_crypto_key.id,
* kms_key_service_account=default_account.email,
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.Network("default", new()
* {
* Name = "workstation-cluster",
* AutoCreateSubnetworks = false,
* });
* var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
* {
* Name = "workstation-cluster",
* IpCidrRange = "10.0.0.0/24",
* Region = "us-central1",
* Network = @default.Name,
* });
* var defaultWorkstationCluster = new Gcp.Workstations.WorkstationCluster("default", new()
* {
* WorkstationClusterId = "workstation-cluster",
* Network = @default.Id,
* Subnetwork = defaultSubnetwork.Id,
* Location = "us-central1",
* Labels =
* {
* { "label", "key" },
* },
* Annotations =
* {
* { "label-one", "value-one" },
* },
* });
* var defaultKeyRing = new Gcp.Kms.KeyRing("default", new()
* {
* Name = "workstation-cluster",
* Location = "us-central1",
* });
* var defaultCryptoKey = new Gcp.Kms.CryptoKey("default", new()
* {
* Name = "workstation-cluster",
* KeyRing = defaultKeyRing.Id,
* });
* var defaultAccount = new Gcp.ServiceAccount.Account("default", new()
* {
* AccountId = "my-account",
* DisplayName = "Service Account",
* });
* var defaultWorkstationConfig = new Gcp.Workstations.WorkstationConfig("default", new()
* {
* WorkstationConfigId = "workstation-config",
* WorkstationClusterId = defaultWorkstationCluster.WorkstationClusterId,
* Location = "us-central1",
* Host = new Gcp.Workstations.Inputs.WorkstationConfigHostArgs
* {
* GceInstance = new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceArgs
* {
* MachineType = "e2-standard-4",
* BootDiskSizeGb = 35,
* DisablePublicIpAddresses = true,
* ShieldedInstanceConfig = new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs
* {
* EnableSecureBoot = true,
* EnableVtpm = true,
* },
* },
* },
* EncryptionKey = new Gcp.Workstations.Inputs.WorkstationConfigEncryptionKeyArgs
* {
* KmsKey = defaultCryptoKey.Id,
* KmsKeyServiceAccount = defaultAccount.Email,
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/serviceaccount"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workstations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* IpCidrRange: pulumi.String("10.0.0.0/24"),
* Region: pulumi.String("us-central1"),
* Network: _default.Name,
* })
* if err != nil {
* return err
* }
* defaultWorkstationCluster, err := workstations.NewWorkstationCluster(ctx, "default", &workstations.WorkstationClusterArgs{
* WorkstationClusterId: pulumi.String("workstation-cluster"),
* Network: _default.ID(),
* Subnetwork: defaultSubnetwork.ID(),
* Location: pulumi.String("us-central1"),
* Labels: pulumi.StringMap{
* "label": pulumi.String("key"),
* },
* Annotations: pulumi.StringMap{
* "label-one": pulumi.String("value-one"),
* },
* })
* if err != nil {
* return err
* }
* defaultKeyRing, err := kms.NewKeyRing(ctx, "default", &kms.KeyRingArgs{
* Name: pulumi.String("workstation-cluster"),
* Location: pulumi.String("us-central1"),
* })
* if err != nil {
* return err
* }
* defaultCryptoKey, err := kms.NewCryptoKey(ctx, "default", &kms.CryptoKeyArgs{
* Name: pulumi.String("workstation-cluster"),
* KeyRing: defaultKeyRing.ID(),
* })
* if err != nil {
* return err
* }
* defaultAccount, err := serviceaccount.NewAccount(ctx, "default", &serviceaccount.AccountArgs{
* AccountId: pulumi.String("my-account"),
* DisplayName: pulumi.String("Service Account"),
* })
* if err != nil {
* return err
* }
* _, err = workstations.NewWorkstationConfig(ctx, "default", &workstations.WorkstationConfigArgs{
* WorkstationConfigId: pulumi.String("workstation-config"),
* WorkstationClusterId: defaultWorkstationCluster.WorkstationClusterId,
* Location: pulumi.String("us-central1"),
* Host: &workstations.WorkstationConfigHostArgs{
* GceInstance: &workstations.WorkstationConfigHostGceInstanceArgs{
* MachineType: pulumi.String("e2-standard-4"),
* BootDiskSizeGb: pulumi.Int(35),
* DisablePublicIpAddresses: pulumi.Bool(true),
* ShieldedInstanceConfig: &workstations.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs{
* EnableSecureBoot: pulumi.Bool(true),
* EnableVtpm: pulumi.Bool(true),
* },
* },
* },
* EncryptionKey: &workstations.WorkstationConfigEncryptionKeyArgs{
* KmsKey: defaultCryptoKey.ID(),
* KmsKeyServiceAccount: defaultAccount.Email,
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.workstations.WorkstationCluster;
* import com.pulumi.gcp.workstations.WorkstationClusterArgs;
* import com.pulumi.gcp.kms.KeyRing;
* import com.pulumi.gcp.kms.KeyRingArgs;
* import com.pulumi.gcp.kms.CryptoKey;
* import com.pulumi.gcp.kms.CryptoKeyArgs;
* import com.pulumi.gcp.serviceaccount.Account;
* import com.pulumi.gcp.serviceaccount.AccountArgs;
* import com.pulumi.gcp.workstations.WorkstationConfig;
* import com.pulumi.gcp.workstations.WorkstationConfigArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostGceInstanceArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigEncryptionKeyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var default_ = new Network("default", NetworkArgs.builder()
* .name("workstation-cluster")
* .autoCreateSubnetworks(false)
* .build());
* var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
* .name("workstation-cluster")
* .ipCidrRange("10.0.0.0/24")
* .region("us-central1")
* .network(default_.name())
* .build());
* var defaultWorkstationCluster = new WorkstationCluster("defaultWorkstationCluster", WorkstationClusterArgs.builder()
* .workstationClusterId("workstation-cluster")
* .network(default_.id())
* .subnetwork(defaultSubnetwork.id())
* .location("us-central1")
* .labels(Map.of("label", "key"))
* .annotations(Map.of("label-one", "value-one"))
* .build());
* var defaultKeyRing = new KeyRing("defaultKeyRing", KeyRingArgs.builder()
* .name("workstation-cluster")
* .location("us-central1")
* .build());
* var defaultCryptoKey = new CryptoKey("defaultCryptoKey", CryptoKeyArgs.builder()
* .name("workstation-cluster")
* .keyRing(defaultKeyRing.id())
* .build());
* var defaultAccount = new Account("defaultAccount", AccountArgs.builder()
* .accountId("my-account")
* .displayName("Service Account")
* .build());
* var defaultWorkstationConfig = new WorkstationConfig("defaultWorkstationConfig", WorkstationConfigArgs.builder()
* .workstationConfigId("workstation-config")
* .workstationClusterId(defaultWorkstationCluster.workstationClusterId())
* .location("us-central1")
* .host(WorkstationConfigHostArgs.builder()
* .gceInstance(WorkstationConfigHostGceInstanceArgs.builder()
* .machineType("e2-standard-4")
* .bootDiskSizeGb(35)
* .disablePublicIpAddresses(true)
* .shieldedInstanceConfig(WorkstationConfigHostGceInstanceShieldedInstanceConfigArgs.builder()
* .enableSecureBoot(true)
* .enableVtpm(true)
* .build())
* .build())
* .build())
* .encryptionKey(WorkstationConfigEncryptionKeyArgs.builder()
* .kmsKey(defaultCryptoKey.id())
* .kmsKeyServiceAccount(defaultAccount.email())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Network
* properties:
* name: workstation-cluster
* autoCreateSubnetworks: false
* defaultSubnetwork:
* type: gcp:compute:Subnetwork
* name: default
* properties:
* name: workstation-cluster
* ipCidrRange: 10.0.0.0/24
* region: us-central1
* network: ${default.name}
* defaultWorkstationCluster:
* type: gcp:workstations:WorkstationCluster
* name: default
* properties:
* workstationClusterId: workstation-cluster
* network: ${default.id}
* subnetwork: ${defaultSubnetwork.id}
* location: us-central1
* labels:
* label: key
* annotations:
* label-one: value-one
* defaultKeyRing:
* type: gcp:kms:KeyRing
* name: default
* properties:
* name: workstation-cluster
* location: us-central1
* defaultCryptoKey:
* type: gcp:kms:CryptoKey
* name: default
* properties:
* name: workstation-cluster
* keyRing: ${defaultKeyRing.id}
* defaultAccount:
* type: gcp:serviceaccount:Account
* name: default
* properties:
* accountId: my-account
* displayName: Service Account
* defaultWorkstationConfig:
* type: gcp:workstations:WorkstationConfig
* name: default
* properties:
* workstationConfigId: workstation-config
* workstationClusterId: ${defaultWorkstationCluster.workstationClusterId}
* location: us-central1
* host:
* gceInstance:
* machineType: e2-standard-4
* bootDiskSizeGb: 35
* disablePublicIpAddresses: true
* shieldedInstanceConfig:
* enableSecureBoot: true
* enableVtpm: true
* encryptionKey:
* kmsKey: ${defaultCryptoKey.id}
* kmsKeyServiceAccount: ${defaultAccount.email}
* ```
*
* ## Import
* WorkstationConfig can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs/{{workstation_config_id}}`
* * `{{project}}/{{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}`
* * `{{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}`
* When using the `pulumi import` command, WorkstationConfig can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:workstations/workstationConfig:WorkstationConfig default projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs/{{workstation_config_id}}
* ```
* ```sh
* $ pulumi import gcp:workstations/workstationConfig:WorkstationConfig default {{project}}/{{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}
* ```
* ```sh
* $ pulumi import gcp:workstations/workstationConfig:WorkstationConfig default {{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}
* ```
*/
public class WorkstationConfig internal constructor(
override val javaResource: com.pulumi.gcp.workstations.WorkstationConfig,
) : KotlinCustomResource(javaResource, WorkstationConfigMapper) {
/**
* Client-specified annotations. This is distinct from labels.
* **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
* Please refer to the field `effective_annotations` for all of the annotations present on the resource.
*/
public val annotations: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy