@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
218 lines • 8.53 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.RuntimeTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* 'A runtime template is a VM configuration that specifies a machine type and other characteristics of the VM,
* as well as common settings such as the network and whether public internet access is enabled. When you create
* a runtime, its VM is created according to the specifications of a runtime template.'
*
* To get more information about RuntimeTemplate, see:
*
* * [API documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.notebookRuntimeTemplates)
* * How-to Guides
* * [Create a runtime template](https://cloud.google.com/colab/docs/create-runtime-template)
*
* ## Example Usage
*
* ### Colab Runtime Template Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const runtime_template = new gcp.colab.RuntimeTemplate("runtime-template", {
* name: "colab-runtime-template",
* displayName: "Runtime template basic",
* location: "us-central1",
* machineSpec: {
* machineType: "e2-standard-4",
* },
* networkSpec: {
* enableInternetAccess: true,
* },
* });
* ```
* ### Colab Runtime Template No Name
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const runtime_template = new gcp.colab.RuntimeTemplate("runtime-template", {
* displayName: "Runtime template no name",
* location: "us-central1",
* machineSpec: {
* machineType: "e2-standard-4",
* },
* networkSpec: {
* enableInternetAccess: true,
* },
* });
* ```
* ### Colab Runtime Template Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const myNetwork = new gcp.compute.Network("my_network", {
* name: "colab-test-default",
* autoCreateSubnetworks: false,
* });
* const mySubnetwork = new gcp.compute.Subnetwork("my_subnetwork", {
* name: "colab-test-default",
* network: myNetwork.id,
* region: "us-central1",
* ipCidrRange: "10.0.1.0/24",
* });
* const runtime_template = new gcp.colab.RuntimeTemplate("runtime-template", {
* name: "colab-runtime-template",
* 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,
* network: myNetwork.id,
* subnetwork: mySubnetwork.id,
* },
* labels: {
* k: "val",
* },
* idleShutdownConfig: {
* idleTimeout: "3600s",
* },
* eucConfig: {
* eucDisabled: false,
* },
* shieldedVmConfig: {
* enableSecureBoot: false,
* },
* networkTags: [
* "abc",
* "def",
* ],
* encryptionSpec: {
* kmsKeyName: "my-crypto-key",
* },
* });
* ```
*
* ## Import
*
* RuntimeTemplate can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/notebookRuntimeTemplates/{{name}}`
*
* * `{{project}}/{{location}}/{{name}}`
*
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, RuntimeTemplate can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:colab/runtimeTemplate:RuntimeTemplate default projects/{{project}}/locations/{{location}}/notebookRuntimeTemplates/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:colab/runtimeTemplate:RuntimeTemplate default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:colab/runtimeTemplate:RuntimeTemplate default {{location}}/{{name}}
* ```
*/
class RuntimeTemplate extends pulumi.CustomResource {
/**
* Get an existing RuntimeTemplate 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 RuntimeTemplate(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of RuntimeTemplate. 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'] === RuntimeTemplate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["dataPersistentDiskSpec"] = state?.dataPersistentDiskSpec;
resourceInputs["description"] = state?.description;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["effectiveLabels"] = state?.effectiveLabels;
resourceInputs["encryptionSpec"] = state?.encryptionSpec;
resourceInputs["eucConfig"] = state?.eucConfig;
resourceInputs["idleShutdownConfig"] = state?.idleShutdownConfig;
resourceInputs["labels"] = state?.labels;
resourceInputs["location"] = state?.location;
resourceInputs["machineSpec"] = state?.machineSpec;
resourceInputs["name"] = state?.name;
resourceInputs["networkSpec"] = state?.networkSpec;
resourceInputs["networkTags"] = state?.networkTags;
resourceInputs["project"] = state?.project;
resourceInputs["pulumiLabels"] = state?.pulumiLabels;
resourceInputs["shieldedVmConfig"] = state?.shieldedVmConfig;
resourceInputs["softwareConfig"] = state?.softwareConfig;
}
else {
const args = argsOrState;
if (args?.displayName === undefined && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["dataPersistentDiskSpec"] = args?.dataPersistentDiskSpec;
resourceInputs["description"] = args?.description;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["encryptionSpec"] = args?.encryptionSpec;
resourceInputs["eucConfig"] = args?.eucConfig;
resourceInputs["idleShutdownConfig"] = args?.idleShutdownConfig;
resourceInputs["labels"] = args?.labels;
resourceInputs["location"] = args?.location;
resourceInputs["machineSpec"] = args?.machineSpec;
resourceInputs["name"] = args?.name;
resourceInputs["networkSpec"] = args?.networkSpec;
resourceInputs["networkTags"] = args?.networkTags;
resourceInputs["project"] = args?.project;
resourceInputs["shieldedVmConfig"] = args?.shieldedVmConfig;
resourceInputs["softwareConfig"] = args?.softwareConfig;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(RuntimeTemplate.__pulumiType, name, resourceInputs, opts);
}
}
exports.RuntimeTemplate = RuntimeTemplate;
/** @internal */
RuntimeTemplate.__pulumiType = 'gcp:colab/runtimeTemplate:RuntimeTemplate';
//# sourceMappingURL=runtimeTemplate.js.map
;