import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * A Workbench instance. * * To get more information about Instance, see: * * * [API documentation](https://cloud.google.com/vertex-ai/docs/workbench/reference/rest/v2/projects.locations.instances) * * How-to Guides * * [Official Documentation](https://cloud.google.com/vertex-ai/docs/workbench/instances/introduction) * * ## 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", * }); * ``` * ### 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", * }, * }, * }); * ``` * ### Workbench Instance Basic Gpu * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const gpuReservation = new gcp.compute.Reservation("gpu_reservation", { * name: "wbi-reservation", * zone: "us-central1-a", * specificReservation: { * count: 1, * instanceProperties: { * machineType: "n1-standard-1", * guestAccelerators: [{ * acceleratorType: "nvidia-tesla-t4", * acceleratorCount: 1, * }], * }, * }, * specificReservationRequired: false, * }); * 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", * }, * reservationAffinity: { * consumeReservationType: "RESERVATION_ANY", * }, * }, * }, { * dependsOn: [gpuReservation], * }); * ``` * ### 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: "my@service-account.com", * }], * metadata: { * terraform: "true", * }, * }, * 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 static = new gcp.compute.Address("static", {name: "wbi-test-default"}); * const actAsPermission = new gcp.serviceaccount.IAMBinding("act_as_permission", { * serviceAccountId: "projects/my-project-name/serviceAccounts/my@service-account.com", * role: "roles/iam.serviceAccountUser", * members: ["user:example@example.com"], * }); * const gpuReservation = new gcp.compute.Reservation("gpu_reservation", { * name: "wbi-reservation", * zone: "us-central1-a", * specificReservation: { * count: 1, * instanceProperties: { * machineType: "n1-standard-4", * guestAccelerators: [{ * acceleratorType: "nvidia-tesla-t4", * acceleratorCount: 1, * }], * }, * }, * specificReservationRequired: true, * }); * 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: "my@service-account.com", * }], * 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", * accessConfigs: [{ * externalIp: static.address, * }], * }], * metadata: { * terraform: "true", * "serial-port-logging-enable": "false", * "enable-jupyterlab4": "false", * }, * reservationAffinity: { * consumeReservationType: "RESERVATION_SPECIFIC", * key: "compute.googleapis.com/reservation-name", * values: [gpuReservation.name], * }, * enableIpForwarding: true, * tags: [ * "abc", * "def", * ], * }, * disableProxyAccess: true, * instanceOwners: ["example@example.com"], * labels: { * k: "val", * }, * desiredState: "ACTIVE", * enableThirdPartyIdentity: true, * }, { * dependsOn: [ * myNetwork, * mySubnetwork, * static, * actAsPermission, * gpuReservation, * ], * }); * ``` * ### Workbench Instance Confidential Compute * * ```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: "n2d-standard-2", * shieldedInstanceConfig: { * enableSecureBoot: true, * enableVtpm: true, * enableIntegrityMonitoring: true, * }, * metadata: { * terraform: "true", * }, * confidentialInstanceConfig: { * confidentialInstanceType: "SEV", * }, * }, * }); * ``` * ### Workbench Instance Euc * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const actAsPermission = new gcp.serviceaccount.IAMBinding("act_as_permission", { * serviceAccountId: "projects/my-project-name/serviceAccounts/1111111111111-compute@developer.gserviceaccount.com", * role: "roles/iam.serviceAccountUser", * members: ["user:example@example.com"], * }); * const instance = new gcp.workbench.Instance("instance", { * name: "workbench-instance", * location: "us-central1-a", * gceSetup: { * machineType: "e2-standard-4", * metadata: { * terraform: "true", * }, * }, * instanceOwners: ["example@example.com"], * enableManagedEuc: true, * }, { * dependsOn: [actAsPermission], * }); * ``` * * ## 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}} * $ pulumi import gcp:workbench/instance:Instance default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:workbench/instance:Instance default {{location}}/{{name}} * ``` */ export declare class Instance extends pulumi.CustomResource { /** * Get an existing Instance resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: InstanceState, opts?: pulumi.CustomResourceOptions): Instance; /** * Returns true if the given object is an instance of Instance. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Instance; /** * An RFC3339 timestamp in UTC time. This in the format of yyyy-MM-ddTHH:mm:ss.SSSZ. * The milliseconds portion (".SSS") is optional. */ readonly createTime: pulumi.Output; /** * Output only. Email address of entity that sent original CreateInstance request. */ readonly creator: pulumi.Output; /** * Desired state of the Workbench Instance. Set this field to `ACTIVE` to start the Instance, and `STOPPED` to stop the Instance. */ readonly desiredState: pulumi.Output; /** * Optional. If true, the workbench instance will not register with the proxy. */ readonly disableProxyAccess: pulumi.Output; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * Flag to enable managed end user credentials for the instance. */ readonly enableManagedEuc: pulumi.Output; /** * Flag that specifies that a notebook can be accessed with third party * identity provider. */ readonly enableThirdPartyIdentity: pulumi.Output; /** * The definition of how to configure a VM instance outside of Resources and Identity. * Structure is documented below. */ readonly gceSetup: pulumi.Output; /** * 'Output only. Additional information about instance health. Example: * healthInfo": { "dockerProxyAgentStatus": "1", "dockerStatus": "1", "jupyterlabApiStatus": * "-1", "jupyterlabStatus": "-1", "updated": "2020-10-18 09:40:03.573409" }' */ readonly healthInfos: pulumi.Output; /** * Output only. Instance health_state. */ readonly healthState: pulumi.Output; /** * Required. User-defined unique ID of this instance. */ readonly instanceId: pulumi.Output; /** * 'Optional. Input only. The owner of this instance after creation. Format: * `alias@example.com` 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. * If specified, sets the access mode to `Single user`. For more details, see * https://cloud.google.com/vertex-ai/docs/workbench/instances/manage-access-jupyterlab' */ readonly instanceOwners: pulumi.Output; /** * 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 `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Part of `parent`. See documentation of `projectsId`. */ readonly location: pulumi.Output; /** * The name of this workbench instance. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}` */ readonly name: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * Output only. The proxy endpoint that is used to access the Jupyter notebook. */ readonly proxyUri: pulumi.Output; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * (Output) * Output only. The state of this instance upgrade history entry. */ readonly state: pulumi.Output; /** * An RFC3339 timestamp in UTC time. This in the format of yyyy-MM-ddTHH:mm:ss.SSSZ. * The milliseconds portion (".SSS") is optional. */ readonly updateTime: pulumi.Output; /** * Output only. The upgrade history of this instance. * Structure is documented below. */ readonly upgradeHistories: pulumi.Output; /** * Create a Instance resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: InstanceArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Instance resources. */ export interface InstanceState { /** * An RFC3339 timestamp in UTC time. This in the format of yyyy-MM-ddTHH:mm:ss.SSSZ. * The milliseconds portion (".SSS") is optional. */ createTime?: pulumi.Input; /** * Output only. Email address of entity that sent original CreateInstance request. */ creator?: pulumi.Input; /** * Desired state of the Workbench Instance. Set this field to `ACTIVE` to start the Instance, and `STOPPED` to stop the Instance. */ desiredState?: pulumi.Input; /** * Optional. If true, the workbench instance will not register with the proxy. */ disableProxyAccess?: pulumi.Input; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Flag to enable managed end user credentials for the instance. */ enableManagedEuc?: pulumi.Input; /** * Flag that specifies that a notebook can be accessed with third party * identity provider. */ enableThirdPartyIdentity?: pulumi.Input; /** * The definition of how to configure a VM instance outside of Resources and Identity. * Structure is documented below. */ gceSetup?: pulumi.Input; /** * 'Output only. Additional information about instance health. Example: * healthInfo": { "dockerProxyAgentStatus": "1", "dockerStatus": "1", "jupyterlabApiStatus": * "-1", "jupyterlabStatus": "-1", "updated": "2020-10-18 09:40:03.573409" }' */ healthInfos?: pulumi.Input[]>; /** * Output only. Instance health_state. */ healthState?: pulumi.Input; /** * Required. User-defined unique ID of this instance. */ instanceId?: pulumi.Input; /** * 'Optional. Input only. The owner of this instance after creation. Format: * `alias@example.com` 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. * If specified, sets the access mode to `Single user`. For more details, see * https://cloud.google.com/vertex-ai/docs/workbench/instances/manage-access-jupyterlab' */ instanceOwners?: pulumi.Input[]>; /** * 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 `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Part of `parent`. See documentation of `projectsId`. */ location?: pulumi.Input; /** * The name of this workbench instance. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}` */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * Output only. The proxy endpoint that is used to access the Jupyter notebook. */ proxyUri?: pulumi.Input; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * (Output) * Output only. The state of this instance upgrade history entry. */ state?: pulumi.Input; /** * An RFC3339 timestamp in UTC time. This in the format of yyyy-MM-ddTHH:mm:ss.SSSZ. * The milliseconds portion (".SSS") is optional. */ updateTime?: pulumi.Input; /** * Output only. The upgrade history of this instance. * Structure is documented below. */ upgradeHistories?: pulumi.Input[]>; } /** * The set of arguments for constructing a Instance resource. */ export interface InstanceArgs { /** * Desired state of the Workbench Instance. Set this field to `ACTIVE` to start the Instance, and `STOPPED` to stop the Instance. */ desiredState?: pulumi.Input; /** * Optional. If true, the workbench instance will not register with the proxy. */ disableProxyAccess?: pulumi.Input; /** * Flag to enable managed end user credentials for the instance. */ enableManagedEuc?: pulumi.Input; /** * Flag that specifies that a notebook can be accessed with third party * identity provider. */ enableThirdPartyIdentity?: pulumi.Input; /** * The definition of how to configure a VM instance outside of Resources and Identity. * Structure is documented below. */ gceSetup?: pulumi.Input; /** * Required. User-defined unique ID of this instance. */ instanceId?: pulumi.Input; /** * 'Optional. Input only. The owner of this instance after creation. Format: * `alias@example.com` 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. * If specified, sets the access mode to `Single user`. For more details, see * https://cloud.google.com/vertex-ai/docs/workbench/instances/manage-access-jupyterlab' */ instanceOwners?: pulumi.Input[]>; /** * 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 `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Part of `parent`. See documentation of `projectsId`. */ location: pulumi.Input; /** * The name of this workbench instance. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}` */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; }