com.pulumi.gcp.workbench.kotlin.InstanceArgs.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.workbench.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.workbench.InstanceArgs.builder
import com.pulumi.gcp.workbench.kotlin.inputs.InstanceGceSetupArgs
import com.pulumi.gcp.workbench.kotlin.inputs.InstanceGceSetupArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* A Workbench instance.
* ## Example Usage
* ### Workbench Instance Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const instance = new gcp.workbench.Instance("instance", {
* name: "workbench-instance",
* location: "us-west1-a",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* instance = gcp.workbench.Instance("instance",
* name="workbench-instance",
* location="us-west1-a")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var instance = new Gcp.Workbench.Instance("instance", new()
* {
* Name = "workbench-instance",
* Location = "us-west1-a",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workbench"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := workbench.NewInstance(ctx, "instance", &workbench.InstanceArgs{
* Name: pulumi.String("workbench-instance"),
* Location: pulumi.String("us-west1-a"),
* })
* 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.workbench.Instance;
* import com.pulumi.gcp.workbench.InstanceArgs;
* 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 instance = new Instance("instance", InstanceArgs.builder()
* .name("workbench-instance")
* .location("us-west1-a")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* instance:
* type: gcp:workbench:Instance
* properties:
* name: workbench-instance
* location: us-west1-a
* ```
*
* ### Workbench Instance Basic Container
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const instance = new gcp.workbench.Instance("instance", {
* name: "workbench-instance",
* location: "us-west1-a",
* gceSetup: {
* containerImage: {
* repository: "us-docker.pkg.dev/deeplearning-platform-release/gcr.io/base-cu113.py310",
* tag: "latest",
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* instance = gcp.workbench.Instance("instance",
* name="workbench-instance",
* location="us-west1-a",
* gce_setup=gcp.workbench.InstanceGceSetupArgs(
* container_image=gcp.workbench.InstanceGceSetupContainerImageArgs(
* repository="us-docker.pkg.dev/deeplearning-platform-release/gcr.io/base-cu113.py310",
* tag="latest",
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var instance = new Gcp.Workbench.Instance("instance", new()
* {
* Name = "workbench-instance",
* Location = "us-west1-a",
* GceSetup = new Gcp.Workbench.Inputs.InstanceGceSetupArgs
* {
* ContainerImage = new Gcp.Workbench.Inputs.InstanceGceSetupContainerImageArgs
* {
* Repository = "us-docker.pkg.dev/deeplearning-platform-release/gcr.io/base-cu113.py310",
* Tag = "latest",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workbench"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := workbench.NewInstance(ctx, "instance", &workbench.InstanceArgs{
* Name: pulumi.String("workbench-instance"),
* Location: pulumi.String("us-west1-a"),
* GceSetup: &workbench.InstanceGceSetupArgs{
* ContainerImage: &workbench.InstanceGceSetupContainerImageArgs{
* Repository: pulumi.String("us-docker.pkg.dev/deeplearning-platform-release/gcr.io/base-cu113.py310"),
* Tag: pulumi.String("latest"),
* },
* },
* })
* 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.workbench.Instance;
* import com.pulumi.gcp.workbench.InstanceArgs;
* import com.pulumi.gcp.workbench.inputs.InstanceGceSetupArgs;
* import com.pulumi.gcp.workbench.inputs.InstanceGceSetupContainerImageArgs;
* 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 instance = new Instance("instance", InstanceArgs.builder()
* .name("workbench-instance")
* .location("us-west1-a")
* .gceSetup(InstanceGceSetupArgs.builder()
* .containerImage(InstanceGceSetupContainerImageArgs.builder()
* .repository("us-docker.pkg.dev/deeplearning-platform-release/gcr.io/base-cu113.py310")
* .tag("latest")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* instance:
* type: gcp:workbench:Instance
* properties:
* name: workbench-instance
* location: us-west1-a
* gceSetup:
* containerImage:
* repository: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/base-cu113.py310
* tag: latest
* ```
*
* ### Workbench Instance Basic Gpu
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const instance = new gcp.workbench.Instance("instance", {
* name: "workbench-instance",
* location: "us-central1-a",
* gceSetup: {
* machineType: "n1-standard-1",
* acceleratorConfigs: [{
* type: "NVIDIA_TESLA_T4",
* coreCount: "1",
* }],
* vmImage: {
* project: "cloud-notebooks-managed",
* family: "workbench-instances",
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* instance = gcp.workbench.Instance("instance",
* name="workbench-instance",
* location="us-central1-a",
* gce_setup=gcp.workbench.InstanceGceSetupArgs(
* machine_type="n1-standard-1",
* accelerator_configs=[gcp.workbench.InstanceGceSetupAcceleratorConfigArgs(
* type="NVIDIA_TESLA_T4",
* core_count="1",
* )],
* vm_image=gcp.workbench.InstanceGceSetupVmImageArgs(
* project="cloud-notebooks-managed",
* family="workbench-instances",
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var instance = new Gcp.Workbench.Instance("instance", new()
* {
* Name = "workbench-instance",
* Location = "us-central1-a",
* GceSetup = new Gcp.Workbench.Inputs.InstanceGceSetupArgs
* {
* MachineType = "n1-standard-1",
* AcceleratorConfigs = new[]
* {
* new Gcp.Workbench.Inputs.InstanceGceSetupAcceleratorConfigArgs
* {
* Type = "NVIDIA_TESLA_T4",
* CoreCount = "1",
* },
* },
* VmImage = new Gcp.Workbench.Inputs.InstanceGceSetupVmImageArgs
* {
* Project = "cloud-notebooks-managed",
* Family = "workbench-instances",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workbench"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := workbench.NewInstance(ctx, "instance", &workbench.InstanceArgs{
* Name: pulumi.String("workbench-instance"),
* Location: pulumi.String("us-central1-a"),
* GceSetup: &workbench.InstanceGceSetupArgs{
* MachineType: pulumi.String("n1-standard-1"),
* AcceleratorConfigs: workbench.InstanceGceSetupAcceleratorConfigArray{
* &workbench.InstanceGceSetupAcceleratorConfigArgs{
* Type: pulumi.String("NVIDIA_TESLA_T4"),
* CoreCount: pulumi.String("1"),
* },
* },
* VmImage: &workbench.InstanceGceSetupVmImageArgs{
* Project: pulumi.String("cloud-notebooks-managed"),
* Family: pulumi.String("workbench-instances"),
* },
* },
* })
* 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.workbench.Instance;
* import com.pulumi.gcp.workbench.InstanceArgs;
* import com.pulumi.gcp.workbench.inputs.InstanceGceSetupArgs;
* import com.pulumi.gcp.workbench.inputs.InstanceGceSetupVmImageArgs;
* 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 instance = new Instance("instance", InstanceArgs.builder()
* .name("workbench-instance")
* .location("us-central1-a")
* .gceSetup(InstanceGceSetupArgs.builder()
* .machineType("n1-standard-1")
* .acceleratorConfigs(InstanceGceSetupAcceleratorConfigArgs.builder()
* .type("NVIDIA_TESLA_T4")
* .coreCount(1)
* .build())
* .vmImage(InstanceGceSetupVmImageArgs.builder()
* .project("cloud-notebooks-managed")
* .family("workbench-instances")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* instance:
* type: gcp:workbench:Instance
* properties:
* name: workbench-instance
* location: us-central1-a
* gceSetup:
* machineType: n1-standard-1
* acceleratorConfigs:
* - type: NVIDIA_TESLA_T4
* coreCount: 1
* vmImage:
* project: cloud-notebooks-managed
* family: workbench-instances
* ```
*
* ### Workbench Instance Labels Stopped
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const instance = new gcp.workbench.Instance("instance", {
* name: "workbench-instance",
* location: "us-central1-a",
* gceSetup: {
* machineType: "e2-standard-4",
* shieldedInstanceConfig: {
* enableSecureBoot: false,
* enableVtpm: false,
* enableIntegrityMonitoring: false,
* },
* serviceAccounts: [{
* email: "[email protected]",
* }],
* metadata: {
* terraform: "true",
* },
* },
* instanceOwners: ["my@service-account.com"],
* labels: {
* k: "val",
* },
* desiredState: "STOPPED",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* instance = gcp.workbench.Instance("instance",
* name="workbench-instance",
* location="us-central1-a",
* gce_setup=gcp.workbench.InstanceGceSetupArgs(
* machine_type="e2-standard-4",
* shielded_instance_config=gcp.workbench.InstanceGceSetupShieldedInstanceConfigArgs(
* enable_secure_boot=False,
* enable_vtpm=False,
* enable_integrity_monitoring=False,
* ),
* service_accounts=[gcp.workbench.InstanceGceSetupServiceAccountArgs(
* email="[email protected]",
* )],
* metadata={
* "terraform": "true",
* },
* ),
* instance_owners=["my@service-account.com"],
* labels={
* "k": "val",
* },
* desired_state="STOPPED")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var instance = new Gcp.Workbench.Instance("instance", new()
* {
* Name = "workbench-instance",
* Location = "us-central1-a",
* GceSetup = new Gcp.Workbench.Inputs.InstanceGceSetupArgs
* {
* MachineType = "e2-standard-4",
* ShieldedInstanceConfig = new Gcp.Workbench.Inputs.InstanceGceSetupShieldedInstanceConfigArgs
* {
* EnableSecureBoot = false,
* EnableVtpm = false,
* EnableIntegrityMonitoring = false,
* },
* ServiceAccounts = new[]
* {
* new Gcp.Workbench.Inputs.InstanceGceSetupServiceAccountArgs
* {
* Email = "[email protected]",
* },
* },
* Metadata =
* {
* { "terraform", "true" },
* },
* },
* InstanceOwners = new[]
* {
* "[email protected]",
* },
* Labels =
* {
* { "k", "val" },
* },
* DesiredState = "STOPPED",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workbench"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := workbench.NewInstance(ctx, "instance", &workbench.InstanceArgs{
* Name: pulumi.String("workbench-instance"),
* Location: pulumi.String("us-central1-a"),
* GceSetup: &workbench.InstanceGceSetupArgs{
* MachineType: pulumi.String("e2-standard-4"),
* ShieldedInstanceConfig: &workbench.InstanceGceSetupShieldedInstanceConfigArgs{
* EnableSecureBoot: pulumi.Bool(false),
* EnableVtpm: pulumi.Bool(false),
* EnableIntegrityMonitoring: pulumi.Bool(false),
* },
* ServiceAccounts: workbench.InstanceGceSetupServiceAccountArray{
* &workbench.InstanceGceSetupServiceAccountArgs{
* Email: pulumi.String("[email protected]"),
* },
* },
* Metadata: pulumi.StringMap{
* "terraform": pulumi.String("true"),
* },
* },
* InstanceOwners: pulumi.StringArray{
* pulumi.String("[email protected]"),
* },
* Labels: pulumi.StringMap{
* "k": pulumi.String("val"),
* },
* DesiredState: pulumi.String("STOPPED"),
* })
* 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.workbench.Instance;
* import com.pulumi.gcp.workbench.InstanceArgs;
* import com.pulumi.gcp.workbench.inputs.InstanceGceSetupArgs;
* import com.pulumi.gcp.workbench.inputs.InstanceGceSetupShieldedInstanceConfigArgs;
* 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 instance = new Instance("instance", InstanceArgs.builder()
* .name("workbench-instance")
* .location("us-central1-a")
* .gceSetup(InstanceGceSetupArgs.builder()
* .machineType("e2-standard-4")
* .shieldedInstanceConfig(InstanceGceSetupShieldedInstanceConfigArgs.builder()
* .enableSecureBoot(false)
* .enableVtpm(false)
* .enableIntegrityMonitoring(false)
* .build())
* .serviceAccounts(InstanceGceSetupServiceAccountArgs.builder()
* .email("[email protected]")
* .build())
* .metadata(Map.of("terraform", "true"))
* .build())
* .instanceOwners("[email protected]")
* .labels(Map.of("k", "val"))
* .desiredState("STOPPED")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* instance:
* type: gcp:workbench:Instance
* properties:
* name: workbench-instance
* location: us-central1-a
* gceSetup:
* machineType: e2-standard-4
* shieldedInstanceConfig:
* enableSecureBoot: false
* enableVtpm: false
* enableIntegrityMonitoring: false
* serviceAccounts:
* - email: [email protected]
* metadata:
* terraform: 'true'
* instanceOwners:
* - [email protected]
* labels:
* k: val
* desiredState: STOPPED
* ```
*
* ### Workbench Instance Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const myNetwork = new gcp.compute.Network("my_network", {
* name: "wbi-test-default",
* autoCreateSubnetworks: false,
* });
* const mySubnetwork = new gcp.compute.Subnetwork("my_subnetwork", {
* name: "wbi-test-default",
* network: myNetwork.id,
* region: "us-central1",
* ipCidrRange: "10.0.1.0/24",
* });
* const instance = new gcp.workbench.Instance("instance", {
* name: "workbench-instance",
* location: "us-central1-a",
* gceSetup: {
* machineType: "n1-standard-4",
* acceleratorConfigs: [{
* type: "NVIDIA_TESLA_T4",
* coreCount: "1",
* }],
* shieldedInstanceConfig: {
* enableSecureBoot: true,
* enableVtpm: true,
* enableIntegrityMonitoring: true,
* },
* disablePublicIp: false,
* serviceAccounts: [{
* email: "[email protected]",
* }],
* bootDisk: {
* diskSizeGb: "310",
* diskType: "PD_SSD",
* diskEncryption: "CMEK",
* kmsKey: "my-crypto-key",
* },
* dataDisks: {
* diskSizeGb: "330",
* diskType: "PD_SSD",
* diskEncryption: "CMEK",
* kmsKey: "my-crypto-key",
* },
* networkInterfaces: [{
* network: myNetwork.id,
* subnet: mySubnetwork.id,
* nicType: "GVNIC",
* }],
* metadata: {
* terraform: "true",
* },
* enableIpForwarding: true,
* tags: [
* "abc",
* "def",
* ],
* },
* disableProxyAccess: true,
* instanceOwners: ["my@service-account.com"],
* labels: {
* k: "val",
* },
* desiredState: "ACTIVE",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_network = gcp.compute.Network("my_network",
* name="wbi-test-default",
* auto_create_subnetworks=False)
* my_subnetwork = gcp.compute.Subnetwork("my_subnetwork",
* name="wbi-test-default",
* network=my_network.id,
* region="us-central1",
* ip_cidr_range="10.0.1.0/24")
* instance = gcp.workbench.Instance("instance",
* name="workbench-instance",
* location="us-central1-a",
* gce_setup=gcp.workbench.InstanceGceSetupArgs(
* machine_type="n1-standard-4",
* accelerator_configs=[gcp.workbench.InstanceGceSetupAcceleratorConfigArgs(
* type="NVIDIA_TESLA_T4",
* core_count="1",
* )],
* shielded_instance_config=gcp.workbench.InstanceGceSetupShieldedInstanceConfigArgs(
* enable_secure_boot=True,
* enable_vtpm=True,
* enable_integrity_monitoring=True,
* ),
* disable_public_ip=False,
* service_accounts=[gcp.workbench.InstanceGceSetupServiceAccountArgs(
* email="[email protected]",
* )],
* boot_disk=gcp.workbench.InstanceGceSetupBootDiskArgs(
* disk_size_gb="310",
* disk_type="PD_SSD",
* disk_encryption="CMEK",
* kms_key="my-crypto-key",
* ),
* data_disks=gcp.workbench.InstanceGceSetupDataDisksArgs(
* disk_size_gb="330",
* disk_type="PD_SSD",
* disk_encryption="CMEK",
* kms_key="my-crypto-key",
* ),
* network_interfaces=[gcp.workbench.InstanceGceSetupNetworkInterfaceArgs(
* network=my_network.id,
* subnet=my_subnetwork.id,
* nic_type="GVNIC",
* )],
* metadata={
* "terraform": "true",
* },
* enable_ip_forwarding=True,
* tags=[
* "abc",
* "def",
* ],
* ),
* disable_proxy_access=True,
* instance_owners=["my@service-account.com"],
* labels={
* "k": "val",
* },
* desired_state="ACTIVE")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var myNetwork = new Gcp.Compute.Network("my_network", new()
* {
* Name = "wbi-test-default",
* AutoCreateSubnetworks = false,
* });
* var mySubnetwork = new Gcp.Compute.Subnetwork("my_subnetwork", new()
* {
* Name = "wbi-test-default",
* Network = myNetwork.Id,
* Region = "us-central1",
* IpCidrRange = "10.0.1.0/24",
* });
* var instance = new Gcp.Workbench.Instance("instance", new()
* {
* Name = "workbench-instance",
* Location = "us-central1-a",
* GceSetup = new Gcp.Workbench.Inputs.InstanceGceSetupArgs
* {
* MachineType = "n1-standard-4",
* AcceleratorConfigs = new[]
* {
* new Gcp.Workbench.Inputs.InstanceGceSetupAcceleratorConfigArgs
* {
* Type = "NVIDIA_TESLA_T4",
* CoreCount = "1",
* },
* },
* ShieldedInstanceConfig = new Gcp.Workbench.Inputs.InstanceGceSetupShieldedInstanceConfigArgs
* {
* EnableSecureBoot = true,
* EnableVtpm = true,
* EnableIntegrityMonitoring = true,
* },
* DisablePublicIp = false,
* ServiceAccounts = new[]
* {
* new Gcp.Workbench.Inputs.InstanceGceSetupServiceAccountArgs
* {
* Email = "[email protected]",
* },
* },
* BootDisk = new Gcp.Workbench.Inputs.InstanceGceSetupBootDiskArgs
* {
* DiskSizeGb = "310",
* DiskType = "PD_SSD",
* DiskEncryption = "CMEK",
* KmsKey = "my-crypto-key",
* },
* DataDisks = new Gcp.Workbench.Inputs.InstanceGceSetupDataDisksArgs
* {
* DiskSizeGb = "330",
* DiskType = "PD_SSD",
* DiskEncryption = "CMEK",
* KmsKey = "my-crypto-key",
* },
* NetworkInterfaces = new[]
* {
* new Gcp.Workbench.Inputs.InstanceGceSetupNetworkInterfaceArgs
* {
* Network = myNetwork.Id,
* Subnet = mySubnetwork.Id,
* NicType = "GVNIC",
* },
* },
* Metadata =
* {
* { "terraform", "true" },
* },
* EnableIpForwarding = true,
* Tags = new[]
* {
* "abc",
* "def",
* },
* },
* DisableProxyAccess = true,
* InstanceOwners = new[]
* {
* "[email protected]",
* },
* Labels =
* {
* { "k", "val" },
* },
* DesiredState = "ACTIVE",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workbench"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* myNetwork, err := compute.NewNetwork(ctx, "my_network", &compute.NetworkArgs{
* Name: pulumi.String("wbi-test-default"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* mySubnetwork, err := compute.NewSubnetwork(ctx, "my_subnetwork", &compute.SubnetworkArgs{
* Name: pulumi.String("wbi-test-default"),
* Network: myNetwork.ID(),
* Region: pulumi.String("us-central1"),
* IpCidrRange: pulumi.String("10.0.1.0/24"),
* })
* if err != nil {
* return err
* }
* _, err = workbench.NewInstance(ctx, "instance", &workbench.InstanceArgs{
* Name: pulumi.String("workbench-instance"),
* Location: pulumi.String("us-central1-a"),
* GceSetup: &workbench.InstanceGceSetupArgs{
* MachineType: pulumi.String("n1-standard-4"),
* AcceleratorConfigs: workbench.InstanceGceSetupAcceleratorConfigArray{
* &workbench.InstanceGceSetupAcceleratorConfigArgs{
* Type: pulumi.String("NVIDIA_TESLA_T4"),
* CoreCount: pulumi.String("1"),
* },
* },
* ShieldedInstanceConfig: &workbench.InstanceGceSetupShieldedInstanceConfigArgs{
* EnableSecureBoot: pulumi.Bool(true),
* EnableVtpm: pulumi.Bool(true),
* EnableIntegrityMonitoring: pulumi.Bool(true),
* },
* DisablePublicIp: pulumi.Bool(false),
* ServiceAccounts: workbench.InstanceGceSetupServiceAccountArray{
* &workbench.InstanceGceSetupServiceAccountArgs{
* Email: pulumi.String("[email protected]"),
* },
* },
* BootDisk: &workbench.InstanceGceSetupBootDiskArgs{
* DiskSizeGb: pulumi.String("310"),
* DiskType: pulumi.String("PD_SSD"),
* DiskEncryption: pulumi.String("CMEK"),
* KmsKey: pulumi.String("my-crypto-key"),
* },
* DataDisks: &workbench.InstanceGceSetupDataDisksArgs{
* DiskSizeGb: pulumi.String("330"),
* DiskType: pulumi.String("PD_SSD"),
* DiskEncryption: pulumi.String("CMEK"),
* KmsKey: pulumi.String("my-crypto-key"),
* },
* NetworkInterfaces: workbench.InstanceGceSetupNetworkInterfaceArray{
* &workbench.InstanceGceSetupNetworkInterfaceArgs{
* Network: myNetwork.ID(),
* Subnet: mySubnetwork.ID(),
* NicType: pulumi.String("GVNIC"),
* },
* },
* Metadata: pulumi.StringMap{
* "terraform": pulumi.String("true"),
* },
* EnableIpForwarding: pulumi.Bool(true),
* Tags: pulumi.StringArray{
* pulumi.String("abc"),
* pulumi.String("def"),
* },
* },
* DisableProxyAccess: pulumi.Bool(true),
* InstanceOwners: pulumi.StringArray{
* pulumi.String("[email protected]"),
* },
* Labels: pulumi.StringMap{
* "k": pulumi.String("val"),
* },
* DesiredState: pulumi.String("ACTIVE"),
* })
* 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.workbench.Instance;
* import com.pulumi.gcp.workbench.InstanceArgs;
* import com.pulumi.gcp.workbench.inputs.InstanceGceSetupArgs;
* import com.pulumi.gcp.workbench.inputs.InstanceGceSetupShieldedInstanceConfigArgs;
* import com.pulumi.gcp.workbench.inputs.InstanceGceSetupBootDiskArgs;
* import com.pulumi.gcp.workbench.inputs.InstanceGceSetupDataDisksArgs;
* 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 myNetwork = new Network("myNetwork", NetworkArgs.builder()
* .name("wbi-test-default")
* .autoCreateSubnetworks(false)
* .build());
* var mySubnetwork = new Subnetwork("mySubnetwork", SubnetworkArgs.builder()
* .name("wbi-test-default")
* .network(myNetwork.id())
* .region("us-central1")
* .ipCidrRange("10.0.1.0/24")
* .build());
* var instance = new Instance("instance", InstanceArgs.builder()
* .name("workbench-instance")
* .location("us-central1-a")
* .gceSetup(InstanceGceSetupArgs.builder()
* .machineType("n1-standard-4")
* .acceleratorConfigs(InstanceGceSetupAcceleratorConfigArgs.builder()
* .type("NVIDIA_TESLA_T4")
* .coreCount(1)
* .build())
* .shieldedInstanceConfig(InstanceGceSetupShieldedInstanceConfigArgs.builder()
* .enableSecureBoot(true)
* .enableVtpm(true)
* .enableIntegrityMonitoring(true)
* .build())
* .disablePublicIp(false)
* .serviceAccounts(InstanceGceSetupServiceAccountArgs.builder()
* .email("[email protected]")
* .build())
* .bootDisk(InstanceGceSetupBootDiskArgs.builder()
* .diskSizeGb(310)
* .diskType("PD_SSD")
* .diskEncryption("CMEK")
* .kmsKey("my-crypto-key")
* .build())
* .dataDisks(InstanceGceSetupDataDisksArgs.builder()
* .diskSizeGb(330)
* .diskType("PD_SSD")
* .diskEncryption("CMEK")
* .kmsKey("my-crypto-key")
* .build())
* .networkInterfaces(InstanceGceSetupNetworkInterfaceArgs.builder()
* .network(myNetwork.id())
* .subnet(mySubnetwork.id())
* .nicType("GVNIC")
* .build())
* .metadata(Map.of("terraform", "true"))
* .enableIpForwarding(true)
* .tags(
* "abc",
* "def")
* .build())
* .disableProxyAccess("true")
* .instanceOwners("[email protected]")
* .labels(Map.of("k", "val"))
* .desiredState("ACTIVE")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* myNetwork:
* type: gcp:compute:Network
* name: my_network
* properties:
* name: wbi-test-default
* autoCreateSubnetworks: false
* mySubnetwork:
* type: gcp:compute:Subnetwork
* name: my_subnetwork
* properties:
* name: wbi-test-default
* network: ${myNetwork.id}
* region: us-central1
* ipCidrRange: 10.0.1.0/24
* instance:
* type: gcp:workbench:Instance
* properties:
* name: workbench-instance
* location: us-central1-a
* gceSetup:
* machineType: n1-standard-4
* acceleratorConfigs:
* - type: NVIDIA_TESLA_T4
* coreCount: 1
* shieldedInstanceConfig:
* enableSecureBoot: true
* enableVtpm: true
* enableIntegrityMonitoring: true
* disablePublicIp: false
* serviceAccounts:
* - email: [email protected]
* bootDisk:
* diskSizeGb: 310
* diskType: PD_SSD
* diskEncryption: CMEK
* kmsKey: my-crypto-key
* dataDisks:
* diskSizeGb: 330
* diskType: PD_SSD
* diskEncryption: CMEK
* kmsKey: my-crypto-key
* networkInterfaces:
* - network: ${myNetwork.id}
* subnet: ${mySubnetwork.id}
* nicType: GVNIC
* metadata:
* terraform: 'true'
* enableIpForwarding: true
* tags:
* - abc
* - def
* disableProxyAccess: 'true'
* instanceOwners:
* - [email protected]
* labels:
* k: val
* desiredState: ACTIVE
* ```
*
* ## Import
* Instance can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/instances/{{name}}`
* * `{{project}}/{{location}}/{{name}}`
* * `{{location}}/{{name}}`
* When using the `pulumi import` command, Instance can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:workbench/instance:Instance default projects/{{project}}/locations/{{location}}/instances/{{name}}
* ```
* ```sh
* $ pulumi import gcp:workbench/instance:Instance default {{project}}/{{location}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:workbench/instance:Instance default {{location}}/{{name}}
* ```
* @property desiredState Desired state of the Workbench Instance. Set this field to `ACTIVE` to start the Instance, and `STOPPED` to stop the Instance.
* @property disableProxyAccess Optional. If true, the workbench instance will not register with the proxy.
* @property gceSetup The definition of how to configure a VM instance outside of Resources and Identity.
* Structure is documented below.
* @property instanceId Required. User-defined unique ID of this instance.
* @property instanceOwners 'Optional. Input only. The owner of this instance after creation. Format:
* `[email protected]` Currently supports one owner only. If not specified, all of
* the service account users of your VM instance''s service account can use the instance.'
* @property labels Optional. Labels to apply to this instance. These can be later modified
* by the UpdateInstance method.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effective_labels` for all of the labels present on the resource.
* @property location Part of `parent`. See documentation of `projectsId`.
* - - -
* @property name The name of this workbench instance. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
public data class InstanceArgs(
public val desiredState: Output? = null,
public val disableProxyAccess: Output? = null,
public val gceSetup: Output? = null,
public val instanceId: Output? = null,
public val instanceOwners: Output>? = null,
public val labels: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy