@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
338 lines (337 loc) • 10.8 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* 'A runtime is a Google-provisioned virtual machine (VM) that can run the code in your notebook (IPYNB file).'
*
* To get more information about Runtime, see:
*
* * [API documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.notebookRuntimes)
* * How-to Guides
* * [Create a runtime](https://cloud.google.com/colab/docs/create-runtime)
*
* ## Example Usage
*
* ### Colab Runtime Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const myTemplate = new gcp.colab.RuntimeTemplate("my_template", {
* name: "colab-runtime",
* displayName: "Runtime template basic",
* location: "us-central1",
* machineSpec: {
* machineType: "e2-standard-4",
* },
* networkSpec: {
* enableInternetAccess: true,
* },
* });
* const runtime = new gcp.colab.Runtime("runtime", {
* name: "colab-runtime",
* location: "us-central1",
* notebookRuntimeTemplateRef: {
* notebookRuntimeTemplate: myTemplate.id,
* },
* displayName: "Runtime basic",
* runtimeUser: "gterraformtestuser@gmail.com",
* }, {
* dependsOn: [myTemplate],
* });
* ```
* ### Colab Runtime Stopped
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const myTemplate = new gcp.colab.RuntimeTemplate("my_template", {
* name: "colab-runtime",
* displayName: "Runtime template basic",
* location: "us-central1",
* machineSpec: {
* machineType: "e2-standard-4",
* },
* networkSpec: {
* enableInternetAccess: true,
* },
* });
* const runtime = new gcp.colab.Runtime("runtime", {
* name: "colab-runtime",
* location: "us-central1",
* notebookRuntimeTemplateRef: {
* notebookRuntimeTemplate: myTemplate.id,
* },
* desiredState: "STOPPED",
* displayName: "Runtime stopped",
* runtimeUser: "gterraformtestuser@gmail.com",
* }, {
* dependsOn: [myTemplate],
* });
* ```
* ### Colab Runtime Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const myTemplate = new gcp.colab.RuntimeTemplate("my_template", {
* name: "colab-runtime",
* displayName: "Runtime template full",
* location: "us-central1",
* description: "Full runtime template",
* machineSpec: {
* machineType: "n1-standard-2",
* acceleratorType: "NVIDIA_TESLA_T4",
* acceleratorCount: 1,
* },
* dataPersistentDiskSpec: {
* diskType: "pd-standard",
* diskSizeGb: "200",
* },
* networkSpec: {
* enableInternetAccess: true,
* },
* labels: {
* k: "val",
* },
* idleShutdownConfig: {
* idleTimeout: "3600s",
* },
* eucConfig: {
* eucDisabled: true,
* },
* shieldedVmConfig: {
* enableSecureBoot: true,
* },
* networkTags: [
* "abc",
* "def",
* ],
* encryptionSpec: {
* kmsKeyName: "my-crypto-key",
* },
* });
* const runtime = new gcp.colab.Runtime("runtime", {
* name: "colab-runtime",
* location: "us-central1",
* notebookRuntimeTemplateRef: {
* notebookRuntimeTemplate: myTemplate.id,
* },
* displayName: "Runtime full",
* runtimeUser: "gterraformtestuser@gmail.com",
* description: "Full runtime",
* desiredState: "ACTIVE",
* autoUpgrade: true,
* }, {
* dependsOn: [myTemplate],
* });
* ```
*
* ## Import
*
* Runtime can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/notebookRuntimes/{{name}}`
*
* * `{{project}}/{{location}}/{{name}}`
*
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, Runtime can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:colab/runtime:Runtime default projects/{{project}}/locations/{{location}}/notebookRuntimes/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:colab/runtime:Runtime default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:colab/runtime:Runtime default {{location}}/{{name}}
* ```
*/
export declare class Runtime extends pulumi.CustomResource {
/**
* Get an existing Runtime 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?: RuntimeState, opts?: pulumi.CustomResourceOptions): Runtime;
/**
* Returns true if the given object is an instance of Runtime. 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 Runtime;
/**
* Triggers an upgrade anytime the runtime is started if it is upgradable.
*/
readonly autoUpgrade: pulumi.Output<boolean | undefined>;
/**
* The description of the Runtime.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Desired state of the Colab Runtime. Set this field to `RUNNING` to start the runtime, and `STOPPED` to stop it.
*/
readonly desiredState: pulumi.Output<string | undefined>;
/**
* Required. The display name of the Runtime.
*/
readonly displayName: pulumi.Output<string>;
/**
* Output only. Timestamp when this NotebookRuntime will be expired.
*/
readonly expirationTime: pulumi.Output<string>;
/**
* Output only. Checks if the NotebookRuntime is upgradable.
*/
readonly isUpgradable: pulumi.Output<boolean>;
/**
* The location for the resource: https://cloud.google.com/colab/docs/locations
*/
readonly location: pulumi.Output<string>;
/**
* The resource name of the Runtime
*/
readonly name: pulumi.Output<string>;
/**
* 'Runtime specific information used for NotebookRuntime creation.'
* Structure is documented below.
*/
readonly notebookRuntimeTemplateRef: pulumi.Output<outputs.colab.RuntimeNotebookRuntimeTemplateRef | undefined>;
/**
* Output only. The type of the notebook runtime.
*/
readonly notebookRuntimeType: 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>;
/**
* The user email of the NotebookRuntime.
*/
readonly runtimeUser: pulumi.Output<string>;
/**
* Output only. The state of the runtime.
*/
readonly state: pulumi.Output<string>;
/**
* Create a Runtime 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: RuntimeArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Runtime resources.
*/
export interface RuntimeState {
/**
* Triggers an upgrade anytime the runtime is started if it is upgradable.
*/
autoUpgrade?: pulumi.Input<boolean>;
/**
* The description of the Runtime.
*/
description?: pulumi.Input<string>;
/**
* Desired state of the Colab Runtime. Set this field to `RUNNING` to start the runtime, and `STOPPED` to stop it.
*/
desiredState?: pulumi.Input<string>;
/**
* Required. The display name of the Runtime.
*/
displayName?: pulumi.Input<string>;
/**
* Output only. Timestamp when this NotebookRuntime will be expired.
*/
expirationTime?: pulumi.Input<string>;
/**
* Output only. Checks if the NotebookRuntime is upgradable.
*/
isUpgradable?: pulumi.Input<boolean>;
/**
* The location for the resource: https://cloud.google.com/colab/docs/locations
*/
location?: pulumi.Input<string>;
/**
* The resource name of the Runtime
*/
name?: pulumi.Input<string>;
/**
* 'Runtime specific information used for NotebookRuntime creation.'
* Structure is documented below.
*/
notebookRuntimeTemplateRef?: pulumi.Input<inputs.colab.RuntimeNotebookRuntimeTemplateRef>;
/**
* Output only. The type of the notebook runtime.
*/
notebookRuntimeType?: 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>;
/**
* The user email of the NotebookRuntime.
*/
runtimeUser?: pulumi.Input<string>;
/**
* Output only. The state of the runtime.
*/
state?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Runtime resource.
*/
export interface RuntimeArgs {
/**
* Triggers an upgrade anytime the runtime is started if it is upgradable.
*/
autoUpgrade?: pulumi.Input<boolean>;
/**
* The description of the Runtime.
*/
description?: pulumi.Input<string>;
/**
* Desired state of the Colab Runtime. Set this field to `RUNNING` to start the runtime, and `STOPPED` to stop it.
*/
desiredState?: pulumi.Input<string>;
/**
* Required. The display name of the Runtime.
*/
displayName: pulumi.Input<string>;
/**
* The location for the resource: https://cloud.google.com/colab/docs/locations
*/
location: pulumi.Input<string>;
/**
* The resource name of the Runtime
*/
name?: pulumi.Input<string>;
/**
* 'Runtime specific information used for NotebookRuntime creation.'
* Structure is documented below.
*/
notebookRuntimeTemplateRef?: pulumi.Input<inputs.colab.RuntimeNotebookRuntimeTemplateRef>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The user email of the NotebookRuntime.
*/
runtimeUser: pulumi.Input<string>;
}