import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * > **Warning:** `googleNotebookInstance` is deprecated and will be removed in a future major release. Use `gcp.workbench.Instance` instead. * * A Cloud AI Platform Notebook instance. * * > **Note:** Due to limitations of the Notebooks Instance API, many fields * in this resource do not properly detect drift. These fields will also not * appear in state once imported. * * To get more information about Instance, see: * * * [API documentation](https://cloud.google.com/ai-platform/notebooks/docs/reference/rest) * * How-to Guides * * [Official Documentation](https://cloud.google.com/ai-platform-notebooks) * * ## Example Usage * * ### Notebook Instance Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const instance = new gcp.notebooks.Instance("instance", { * name: "notebooks-instance", * location: "us-west1-a", * machineType: "e2-medium", * vmImage: { * project: "cloud-notebooks-managed", * imageFamily: "workbench-instances", * }, * }); * ``` * ### Notebook Instance Basic Stopped * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const instance = new gcp.notebooks.Instance("instance", { * name: "notebooks-instance", * location: "us-west1-a", * machineType: "e2-medium", * vmImage: { * project: "cloud-notebooks-managed", * imageFamily: "workbench-instances", * }, * desiredState: "STOPPED", * }); * ``` * ### Notebook Instance Basic Container * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const instance = new gcp.notebooks.Instance("instance", { * name: "notebooks-instance", * location: "us-west1-a", * machineType: "e2-medium", * metadata: { * "proxy-mode": "service_account", * }, * containerImage: { * repository: "gcr.io/deeplearning-platform-release/base-cpu", * tag: "latest", * }, * }); * ``` * ### Notebook Instance Basic Gpu * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const instance = new gcp.notebooks.Instance("instance", { * name: "notebooks-instance", * location: "us-west1-a", * machineType: "n1-standard-1", * installGpuDriver: true, * acceleratorConfig: { * type: "NVIDIA_TESLA_T4", * coreCount: 1, * }, * vmImage: { * project: "cloud-notebooks-managed", * imageFamily: "workbench-instances", * }, * }); * ``` * ### Notebook Instance Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const myNetwork = gcp.compute.getNetwork({ * name: "default", * }); * const mySubnetwork = gcp.compute.getSubnetwork({ * name: "default", * region: "us-central1", * }); * const instance = new gcp.notebooks.Instance("instance", { * name: "notebooks-instance", * location: "us-central1-a", * machineType: "e2-medium", * vmImage: { * project: "cloud-notebooks-managed", * imageFamily: "workbench-instances", * }, * instanceOwners: ["my@service-account.com"], * serviceAccount: "my@service-account.com", * installGpuDriver: true, * bootDiskType: "PD_SSD", * bootDiskSizeGb: 150, * noPublicIp: true, * noProxyAccess: true, * network: myNetwork.then(myNetwork => myNetwork.id), * subnet: mySubnetwork.then(mySubnetwork => mySubnetwork.id), * labels: { * k: "val", * }, * metadata: { * terraform: "true", * }, * serviceAccountScopes: [ * "https://www.googleapis.com/auth/bigquery", * "https://www.googleapis.com/auth/devstorage.read_write", * "https://www.googleapis.com/auth/cloud-platform", * "https://www.googleapis.com/auth/userinfo.email", * ], * tags: [ * "foo", * "bar", * ], * diskEncryption: "CMEK", * kmsKey: "my-crypto-key", * 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:notebooks/instance:Instance default projects/{{project}}/locations/{{location}}/instances/{{name}} * $ pulumi import gcp:notebooks/instance:Instance default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:notebooks/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; /** * The hardware accelerator used on this instance. If you use accelerators, * make sure that your configuration has enough vCPUs and memory to support the * machineType you have selected. * Structure is documented below. */ readonly acceleratorConfig: pulumi.Output; /** * The size of the boot disk in GB attached to this instance, * up to a maximum of 64000 GB (64 TB). The minimum recommended value is 100 GB. * If not specified, this defaults to 100. */ readonly bootDiskSizeGb: pulumi.Output; /** * Possible disk types for notebook instances. * Possible values are: `DISK_TYPE_UNSPECIFIED`, `PD_STANDARD`, `PD_SSD`, `PD_BALANCED`, `PD_EXTREME`. */ readonly bootDiskType: pulumi.Output; /** * Use a container image to start the notebook instance. * Structure is documented below. */ readonly containerImage: pulumi.Output; /** * Instance creation time */ readonly createTime: pulumi.Output; /** * Specify a custom Cloud Storage path where the GPU driver is stored. * If not specified, we'll automatically choose from official GPU drivers. */ readonly customGpuDriverPath: pulumi.Output; /** * The size of the data disk in GB attached to this instance, * up to a maximum of 64000 GB (64 TB). * You can choose the size of the data disk based on how big your notebooks and data are. * If not specified, this defaults to 100. */ readonly dataDiskSizeGb: pulumi.Output; /** * Possible disk types for notebook instances. * Possible values are: `DISK_TYPE_UNSPECIFIED`, `PD_STANDARD`, `PD_SSD`, `PD_BALANCED`, `PD_EXTREME`. */ readonly dataDiskType: pulumi.Output; /** * Desired state of the Notebook Instance. Set this field to `ACTIVE` to start the Instance, and `STOPPED` to stop the Instance. */ readonly desiredState: pulumi.Output; /** * Disk encryption method used on the boot and data disks, defaults to GMEK. * Possible values are: `DISK_ENCRYPTION_UNSPECIFIED`, `GMEK`, `CMEK`. */ readonly diskEncryption: 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; }>; /** * Whether the end user authorizes Google Cloud to install GPU driver * on this instance. If this field is empty or set to false, the GPU driver * won't be installed. Only applicable to instances with GPUs. */ readonly installGpuDriver: pulumi.Output; /** * The list of owners 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. */ readonly instanceOwners: pulumi.Output; /** * The KMS key used to encrypt the disks, only applicable if diskEncryption is CMEK. * Format: projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id} */ readonly kmsKey: pulumi.Output; /** * Labels to apply to this instance. These can be later modified by the setLabels method. * An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. * * **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>; /** * A reference to the zone where the machine resides. */ readonly location: pulumi.Output; /** * A reference to a machine type which defines VM kind. */ readonly machineType: pulumi.Output; /** * Custom metadata to apply to this instance. * An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. */ readonly metadata: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The name specified for the Notebook instance. */ readonly name: pulumi.Output; /** * The name of the VPC that this instance is in. * Format: projects/{project_id}/global/networks/{network_id} */ readonly network: pulumi.Output; /** * The type of vNIC driver. * Possible values are: `UNSPECIFIED_NIC_TYPE`, `VIRTIO_NET`, `GVNIC`. */ readonly nicType: pulumi.Output; /** * The notebook instance will not register with the proxy.. */ readonly noProxyAccess: pulumi.Output; /** * No public IP will be assigned to this instance. */ readonly noPublicIp: pulumi.Output; /** * If true, the data disk will not be auto deleted when deleting the instance. */ readonly noRemoveDataDisk: pulumi.Output; /** * Path to a Bash script that automatically runs after a * notebook instance fully boots up. The path must be a URL * or Cloud Storage path (gs://path-to-file/file-name). */ readonly postStartupScript: 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; /** * The proxy endpoint that is used to access the Jupyter notebook. * Only returned when the resource is in a `PROVISIONED` state. If * needed you can utilize `pulumi up -refresh-only` to await * the population of this value. */ 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; }>; /** * Reservation Affinity for consuming Zonal reservation. * Structure is documented below. */ readonly reservationAffinity: pulumi.Output; /** * The service account on this instance, giving access to other * Google Cloud services. You can use any service account within * the same project, but you must have the service account user * permission to use the instance. If not specified, * the Compute Engine default service account is used. */ readonly serviceAccount: pulumi.Output; /** * Optional. The URIs of service account scopes to be included in Compute Engine instances. * If not specified, the following scopes are defined: * - https://www.googleapis.com/auth/cloud-platform * - https://www.googleapis.com/auth/userinfo.email */ readonly serviceAccountScopes: pulumi.Output; /** * A set of Shielded Instance options. Check [Images using supported Shielded VM features] * Not all combinations are valid * Structure is documented below. */ readonly shieldedInstanceConfig: pulumi.Output; /** * The state of this instance. */ readonly state: pulumi.Output; /** * The name of the subnet that this instance is in. * Format: projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id} */ readonly subnet: pulumi.Output; /** * The Compute Engine tags to add to instance. */ readonly tags: pulumi.Output; /** * Instance update time. */ readonly updateTime: pulumi.Output; /** * Use a Compute Engine VM image to start the notebook instance. * Structure is documented below. */ readonly vmImage: 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 { /** * The hardware accelerator used on this instance. If you use accelerators, * make sure that your configuration has enough vCPUs and memory to support the * machineType you have selected. * Structure is documented below. */ acceleratorConfig?: pulumi.Input; /** * The size of the boot disk in GB attached to this instance, * up to a maximum of 64000 GB (64 TB). The minimum recommended value is 100 GB. * If not specified, this defaults to 100. */ bootDiskSizeGb?: pulumi.Input; /** * Possible disk types for notebook instances. * Possible values are: `DISK_TYPE_UNSPECIFIED`, `PD_STANDARD`, `PD_SSD`, `PD_BALANCED`, `PD_EXTREME`. */ bootDiskType?: pulumi.Input; /** * Use a container image to start the notebook instance. * Structure is documented below. */ containerImage?: pulumi.Input; /** * Instance creation time */ createTime?: pulumi.Input; /** * Specify a custom Cloud Storage path where the GPU driver is stored. * If not specified, we'll automatically choose from official GPU drivers. */ customGpuDriverPath?: pulumi.Input; /** * The size of the data disk in GB attached to this instance, * up to a maximum of 64000 GB (64 TB). * You can choose the size of the data disk based on how big your notebooks and data are. * If not specified, this defaults to 100. */ dataDiskSizeGb?: pulumi.Input; /** * Possible disk types for notebook instances. * Possible values are: `DISK_TYPE_UNSPECIFIED`, `PD_STANDARD`, `PD_SSD`, `PD_BALANCED`, `PD_EXTREME`. */ dataDiskType?: pulumi.Input; /** * Desired state of the Notebook Instance. Set this field to `ACTIVE` to start the Instance, and `STOPPED` to stop the Instance. */ desiredState?: pulumi.Input; /** * Disk encryption method used on the boot and data disks, defaults to GMEK. * Possible values are: `DISK_ENCRYPTION_UNSPECIFIED`, `GMEK`, `CMEK`. */ diskEncryption?: 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; }>; /** * Whether the end user authorizes Google Cloud to install GPU driver * on this instance. If this field is empty or set to false, the GPU driver * won't be installed. Only applicable to instances with GPUs. */ installGpuDriver?: pulumi.Input; /** * The list of owners 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. */ instanceOwners?: pulumi.Input[]>; /** * The KMS key used to encrypt the disks, only applicable if diskEncryption is CMEK. * Format: projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id} */ kmsKey?: pulumi.Input; /** * Labels to apply to this instance. These can be later modified by the setLabels method. * An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. * * **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; }>; /** * A reference to the zone where the machine resides. */ location?: pulumi.Input; /** * A reference to a machine type which defines VM kind. */ machineType?: pulumi.Input; /** * Custom metadata to apply to this instance. * An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. */ metadata?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The name specified for the Notebook instance. */ name?: pulumi.Input; /** * The name of the VPC that this instance is in. * Format: projects/{project_id}/global/networks/{network_id} */ network?: pulumi.Input; /** * The type of vNIC driver. * Possible values are: `UNSPECIFIED_NIC_TYPE`, `VIRTIO_NET`, `GVNIC`. */ nicType?: pulumi.Input; /** * The notebook instance will not register with the proxy.. */ noProxyAccess?: pulumi.Input; /** * No public IP will be assigned to this instance. */ noPublicIp?: pulumi.Input; /** * If true, the data disk will not be auto deleted when deleting the instance. */ noRemoveDataDisk?: pulumi.Input; /** * Path to a Bash script that automatically runs after a * notebook instance fully boots up. The path must be a URL * or Cloud Storage path (gs://path-to-file/file-name). */ postStartupScript?: 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; /** * The proxy endpoint that is used to access the Jupyter notebook. * Only returned when the resource is in a `PROVISIONED` state. If * needed you can utilize `pulumi up -refresh-only` to await * the population of this value. */ 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; }>; /** * Reservation Affinity for consuming Zonal reservation. * Structure is documented below. */ reservationAffinity?: pulumi.Input; /** * The service account on this instance, giving access to other * Google Cloud services. You can use any service account within * the same project, but you must have the service account user * permission to use the instance. If not specified, * the Compute Engine default service account is used. */ serviceAccount?: pulumi.Input; /** * Optional. The URIs of service account scopes to be included in Compute Engine instances. * If not specified, the following scopes are defined: * - https://www.googleapis.com/auth/cloud-platform * - https://www.googleapis.com/auth/userinfo.email */ serviceAccountScopes?: pulumi.Input[]>; /** * A set of Shielded Instance options. Check [Images using supported Shielded VM features] * Not all combinations are valid * Structure is documented below. */ shieldedInstanceConfig?: pulumi.Input; /** * The state of this instance. */ state?: pulumi.Input; /** * The name of the subnet that this instance is in. * Format: projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id} */ subnet?: pulumi.Input; /** * The Compute Engine tags to add to instance. */ tags?: pulumi.Input[]>; /** * Instance update time. */ updateTime?: pulumi.Input; /** * Use a Compute Engine VM image to start the notebook instance. * Structure is documented below. */ vmImage?: pulumi.Input; } /** * The set of arguments for constructing a Instance resource. */ export interface InstanceArgs { /** * The hardware accelerator used on this instance. If you use accelerators, * make sure that your configuration has enough vCPUs and memory to support the * machineType you have selected. * Structure is documented below. */ acceleratorConfig?: pulumi.Input; /** * The size of the boot disk in GB attached to this instance, * up to a maximum of 64000 GB (64 TB). The minimum recommended value is 100 GB. * If not specified, this defaults to 100. */ bootDiskSizeGb?: pulumi.Input; /** * Possible disk types for notebook instances. * Possible values are: `DISK_TYPE_UNSPECIFIED`, `PD_STANDARD`, `PD_SSD`, `PD_BALANCED`, `PD_EXTREME`. */ bootDiskType?: pulumi.Input; /** * Use a container image to start the notebook instance. * Structure is documented below. */ containerImage?: pulumi.Input; /** * Instance creation time */ createTime?: pulumi.Input; /** * Specify a custom Cloud Storage path where the GPU driver is stored. * If not specified, we'll automatically choose from official GPU drivers. */ customGpuDriverPath?: pulumi.Input; /** * The size of the data disk in GB attached to this instance, * up to a maximum of 64000 GB (64 TB). * You can choose the size of the data disk based on how big your notebooks and data are. * If not specified, this defaults to 100. */ dataDiskSizeGb?: pulumi.Input; /** * Possible disk types for notebook instances. * Possible values are: `DISK_TYPE_UNSPECIFIED`, `PD_STANDARD`, `PD_SSD`, `PD_BALANCED`, `PD_EXTREME`. */ dataDiskType?: pulumi.Input; /** * Desired state of the Notebook Instance. Set this field to `ACTIVE` to start the Instance, and `STOPPED` to stop the Instance. */ desiredState?: pulumi.Input; /** * Disk encryption method used on the boot and data disks, defaults to GMEK. * Possible values are: `DISK_ENCRYPTION_UNSPECIFIED`, `GMEK`, `CMEK`. */ diskEncryption?: pulumi.Input; /** * Whether the end user authorizes Google Cloud to install GPU driver * on this instance. If this field is empty or set to false, the GPU driver * won't be installed. Only applicable to instances with GPUs. */ installGpuDriver?: pulumi.Input; /** * The list of owners 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. */ instanceOwners?: pulumi.Input[]>; /** * The KMS key used to encrypt the disks, only applicable if diskEncryption is CMEK. * Format: projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id} */ kmsKey?: pulumi.Input; /** * Labels to apply to this instance. These can be later modified by the setLabels method. * An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. * * **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; }>; /** * A reference to the zone where the machine resides. */ location: pulumi.Input; /** * A reference to a machine type which defines VM kind. */ machineType: pulumi.Input; /** * Custom metadata to apply to this instance. * An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. */ metadata?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The name specified for the Notebook instance. */ name?: pulumi.Input; /** * The name of the VPC that this instance is in. * Format: projects/{project_id}/global/networks/{network_id} */ network?: pulumi.Input; /** * The type of vNIC driver. * Possible values are: `UNSPECIFIED_NIC_TYPE`, `VIRTIO_NET`, `GVNIC`. */ nicType?: pulumi.Input; /** * The notebook instance will not register with the proxy.. */ noProxyAccess?: pulumi.Input; /** * No public IP will be assigned to this instance. */ noPublicIp?: pulumi.Input; /** * If true, the data disk will not be auto deleted when deleting the instance. */ noRemoveDataDisk?: pulumi.Input; /** * Path to a Bash script that automatically runs after a * notebook instance fully boots up. The path must be a URL * or Cloud Storage path (gs://path-to-file/file-name). */ postStartupScript?: 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; /** * Reservation Affinity for consuming Zonal reservation. * Structure is documented below. */ reservationAffinity?: pulumi.Input; /** * The service account on this instance, giving access to other * Google Cloud services. You can use any service account within * the same project, but you must have the service account user * permission to use the instance. If not specified, * the Compute Engine default service account is used. */ serviceAccount?: pulumi.Input; /** * Optional. The URIs of service account scopes to be included in Compute Engine instances. * If not specified, the following scopes are defined: * - https://www.googleapis.com/auth/cloud-platform * - https://www.googleapis.com/auth/userinfo.email */ serviceAccountScopes?: pulumi.Input[]>; /** * A set of Shielded Instance options. Check [Images using supported Shielded VM features] * Not all combinations are valid * Structure is documented below. */ shieldedInstanceConfig?: pulumi.Input; /** * The name of the subnet that this instance is in. * Format: projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id} */ subnet?: pulumi.Input; /** * The Compute Engine tags to add to instance. */ tags?: pulumi.Input[]>; /** * Instance update time. */ updateTime?: pulumi.Input; /** * Use a Compute Engine VM image to start the notebook instance. * Structure is documented below. */ vmImage?: pulumi.Input; }