UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

297 lines • 10.8 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Runtime = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * > **Warning:** `gcp.notebooks.Runtime` is deprecated and will be removed in a future major release. Use `gcp.workbench.Instance` instead. * * A Cloud AI Platform Notebook runtime. * * > **Note:** Due to limitations of the Notebooks Runtime 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 Runtime, 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 Runtime Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const runtime = new gcp.notebooks.Runtime("runtime", { * name: "notebooks-runtime", * location: "us-central1", * accessConfig: { * accessType: "SINGLE_USER", * runtimeOwner: "admin@hashicorptest.com", * }, * virtualMachine: { * virtualMachineConfig: { * machineType: "n1-standard-4", * dataDisk: { * initializeParams: { * diskSizeGb: 100, * diskType: "PD_STANDARD", * }, * }, * }, * }, * }); * ``` * ### Notebook Runtime Basic Gpu * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const runtimeGpu = new gcp.notebooks.Runtime("runtime_gpu", { * name: "notebooks-runtime-gpu", * location: "us-central1", * accessConfig: { * accessType: "SINGLE_USER", * runtimeOwner: "admin@hashicorptest.com", * }, * softwareConfig: { * installGpuDriver: true, * }, * virtualMachine: { * virtualMachineConfig: { * machineType: "n1-standard-4", * dataDisk: { * initializeParams: { * diskSizeGb: 100, * diskType: "PD_STANDARD", * }, * }, * acceleratorConfig: { * coreCount: 1, * type: "NVIDIA_TESLA_V100", * }, * }, * }, * }); * ``` * ### Notebook Runtime Basic Container * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const runtimeContainer = new gcp.notebooks.Runtime("runtime_container", { * name: "notebooks-runtime-container", * location: "us-central1", * accessConfig: { * accessType: "SINGLE_USER", * runtimeOwner: "admin@hashicorptest.com", * }, * virtualMachine: { * virtualMachineConfig: { * machineType: "n1-standard-4", * dataDisk: { * initializeParams: { * diskSizeGb: 100, * diskType: "PD_STANDARD", * }, * }, * containerImages: [ * { * repository: "gcr.io/deeplearning-platform-release/base-cpu", * tag: "latest", * }, * { * repository: "gcr.io/deeplearning-platform-release/beam-notebooks", * tag: "latest", * }, * ], * }, * }, * }); * ``` * ### Notebook Runtime Kernels * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const runtimeContainer = new gcp.notebooks.Runtime("runtime_container", { * name: "notebooks-runtime-kernel", * location: "us-central1", * accessConfig: { * accessType: "SINGLE_USER", * runtimeOwner: "admin@hashicorptest.com", * }, * softwareConfig: { * kernels: [{ * repository: "gcr.io/deeplearning-platform-release/base-cpu", * tag: "latest", * }], * }, * virtualMachine: { * virtualMachineConfig: { * machineType: "n1-standard-4", * dataDisk: { * initializeParams: { * diskSizeGb: 100, * diskType: "PD_STANDARD", * }, * }, * }, * }, * labels: { * k: "val", * }, * }); * ``` * ### Notebook Runtime Script * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const runtimeContainer = new gcp.notebooks.Runtime("runtime_container", { * name: "notebooks-runtime-script", * location: "us-central1", * accessConfig: { * accessType: "SINGLE_USER", * runtimeOwner: "admin@hashicorptest.com", * }, * softwareConfig: { * postStartupScriptBehavior: "RUN_EVERY_START", * }, * virtualMachine: { * virtualMachineConfig: { * machineType: "n1-standard-4", * dataDisk: { * initializeParams: { * diskSizeGb: 100, * diskType: "PD_STANDARD", * }, * }, * }, * }, * labels: { * k: "val", * }, * }); * ``` * * ## Import * * Runtime can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/runtimes/{{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:notebooks/runtime:Runtime default projects/{{project}}/locations/{{location}}/runtimes/{{name}} * $ pulumi import gcp:notebooks/runtime:Runtime default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:notebooks/runtime:Runtime default {{location}}/{{name}} * ``` */ 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, id, state, opts) { return new Runtime(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:notebooks/runtime: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) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Runtime.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessConfig"] = state?.accessConfig; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["healthState"] = state?.healthState; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["metrics"] = state?.metrics; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["softwareConfig"] = state?.softwareConfig; resourceInputs["state"] = state?.state; resourceInputs["virtualMachine"] = state?.virtualMachine; } else { const args = argsOrState; if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["accessConfig"] = args?.accessConfig; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["softwareConfig"] = args?.softwareConfig; resourceInputs["virtualMachine"] = args?.virtualMachine; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["healthState"] = undefined /*out*/; resourceInputs["metrics"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Runtime.__pulumiType, name, resourceInputs, opts); } } exports.Runtime = Runtime; //# sourceMappingURL=runtime.js.map