@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
509 lines (508 loc) • 18.3 kB
TypeScript
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 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",
* },
* },
* });
* ```
* ### 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 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",
* },
* enableIpForwarding: true,
* tags: [
* "abc",
* "def",
* ],
* },
* disableProxyAccess: true,
* instanceOwners: ["example@example.com"],
* labels: {
* k: "val",
* },
* desiredState: "ACTIVE",
* enableThirdPartyIdentity: true,
* }, {
* dependsOn: [
* myNetwork,
* mySubnetwork,
* static,
* 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}}
* ```
*
* ```sh
* $ pulumi import gcp:workbench/instance:Instance default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ 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<pulumi.ID>, 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<string>;
/**
* Output only. Email address of entity that sent original CreateInstance request.
*/
readonly creator: pulumi.Output<string>;
/**
* 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<string | undefined>;
/**
* Optional. If true, the workbench instance will not register with the proxy.
*/
readonly disableProxyAccess: pulumi.Output<boolean | undefined>;
/**
* 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 that specifies that a notebook can be accessed with third party
* identity provider.
*/
readonly enableThirdPartyIdentity: pulumi.Output<boolean | undefined>;
/**
* The definition of how to configure a VM instance outside of Resources and Identity.
* Structure is documented below.
*/
readonly gceSetup: pulumi.Output<outputs.workbench.InstanceGceSetup>;
/**
* '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<outputs.workbench.InstanceHealthInfo[]>;
/**
* Output only. Instance health_state.
*/
readonly healthState: pulumi.Output<string>;
/**
* Required. User-defined unique ID of this instance.
*/
readonly instanceId: pulumi.Output<string | undefined>;
/**
* '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<string[] | undefined>;
/**
* 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<string>;
/**
* The name of this workbench instance. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
readonly name: pulumi.Output<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* Output only. The proxy endpoint that is used to access the Jupyter notebook.
*/
readonly proxyUri: pulumi.Output<string>;
/**
* 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<string>;
/**
* 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<string>;
/**
* Output only. The upgrade history of this instance.
* Structure is documented below.
*/
readonly upgradeHistories: pulumi.Output<outputs.workbench.InstanceUpgradeHistory[]>;
/**
* 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<string>;
/**
* Output only. Email address of entity that sent original CreateInstance request.
*/
creator?: pulumi.Input<string>;
/**
* Desired state of the Workbench Instance. Set this field to `ACTIVE` to start the Instance, and `STOPPED` to stop the Instance.
*/
desiredState?: pulumi.Input<string>;
/**
* Optional. If true, the workbench instance will not register with the proxy.
*/
disableProxyAccess?: pulumi.Input<boolean>;
/**
* 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<string>;
}>;
/**
* Flag that specifies that a notebook can be accessed with third party
* identity provider.
*/
enableThirdPartyIdentity?: pulumi.Input<boolean>;
/**
* The definition of how to configure a VM instance outside of Resources and Identity.
* Structure is documented below.
*/
gceSetup?: pulumi.Input<inputs.workbench.InstanceGceSetup>;
/**
* '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<pulumi.Input<inputs.workbench.InstanceHealthInfo>[]>;
/**
* Output only. Instance health_state.
*/
healthState?: pulumi.Input<string>;
/**
* Required. User-defined unique ID of this instance.
*/
instanceId?: pulumi.Input<string>;
/**
* '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<pulumi.Input<string>[]>;
/**
* 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<string>;
}>;
/**
* Part of `parent`. See documentation of `projectsId`.
*
*
* - - -
*/
location?: pulumi.Input<string>;
/**
* The name of this workbench instance. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
name?: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* Output only. The proxy endpoint that is used to access the Jupyter notebook.
*/
proxyUri?: pulumi.Input<string>;
/**
* The combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
pulumiLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* (Output)
* Output only. The state of this instance upgrade history entry.
*/
state?: pulumi.Input<string>;
/**
* 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<string>;
/**
* Output only. The upgrade history of this instance.
* Structure is documented below.
*/
upgradeHistories?: pulumi.Input<pulumi.Input<inputs.workbench.InstanceUpgradeHistory>[]>;
}
/**
* 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<string>;
/**
* Optional. If true, the workbench instance will not register with the proxy.
*/
disableProxyAccess?: pulumi.Input<boolean>;
/**
* Flag that specifies that a notebook can be accessed with third party
* identity provider.
*/
enableThirdPartyIdentity?: pulumi.Input<boolean>;
/**
* The definition of how to configure a VM instance outside of Resources and Identity.
* Structure is documented below.
*/
gceSetup?: pulumi.Input<inputs.workbench.InstanceGceSetup>;
/**
* Required. User-defined unique ID of this instance.
*/
instanceId?: pulumi.Input<string>;
/**
* '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<pulumi.Input<string>[]>;
/**
* 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<string>;
}>;
/**
* Part of `parent`. See documentation of `projectsId`.
*
*
* - - -
*/
location: pulumi.Input<string>;
/**
* The name of this workbench instance. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
name?: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
}