UNPKG

@pulumi/gcp

Version:

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

230 lines • 9.72 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.V2Vm = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## Example Usage * * ### Tpu V2 Vm Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const available = gcp.tpu.getV2RuntimeVersions({}); * const tpu = new gcp.tpu.V2Vm("tpu", { * name: "test-tpu", * zone: "us-central1-c", * runtimeVersion: "tpu-vm-tf-2.13.0", * }); * ``` * ### Tpu V2 Vm Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumi/time"; * * const available = gcp.tpu.getV2RuntimeVersions({}); * const availableGetV2AcceleratorTypes = gcp.tpu.getV2AcceleratorTypes({}); * const network = new gcp.compute.Network("network", { * name: "tpu-net", * autoCreateSubnetworks: false, * }); * const subnet = new gcp.compute.Subnetwork("subnet", { * name: "tpu-subnet", * ipCidrRange: "10.0.0.0/16", * region: "us-central1", * network: network.id, * }); * const sa = new gcp.serviceaccount.Account("sa", { * accountId: "tpu-sa", * displayName: "Test TPU VM", * }); * const disk = new gcp.compute.Disk("disk", { * name: "tpu-disk", * image: "debian-cloud/debian-11", * size: 10, * type: "pd-ssd", * zone: "us-central1-c", * }); * // Wait after service account creation to limit eventual consistency errors. * const wait60Seconds = new time.index.Sleep("wait_60_seconds", {createDuration: "60s"}, { * dependsOn: [sa], * }); * const tpu = new gcp.tpu.V2Vm("tpu", { * name: "test-tpu", * zone: "us-central1-c", * description: "Text description of the TPU.", * runtimeVersion: "tpu-vm-tf-2.13.0", * acceleratorConfig: { * type: "V2", * topology: "2x2", * }, * cidrBlock: "10.0.0.0/29", * networkConfig: { * canIpForward: true, * enableExternalIps: true, * network: network.id, * subnetwork: subnet.id, * queueCount: 32, * }, * schedulingConfig: { * preemptible: true, * spot: true, * }, * shieldedInstanceConfig: { * enableSecureBoot: true, * }, * serviceAccount: { * email: sa.email, * scopes: ["https://www.googleapis.com/auth/cloud-platform"], * }, * dataDisks: [{ * sourceDisk: disk.id, * mode: "READ_ONLY", * }], * labels: { * foo: "bar", * }, * metadata: { * foo: "bar", * }, * tags: ["foo"], * }, { * dependsOn: [wait60Seconds], * }); * ``` * * ## Import * * Vm can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{zone}}/nodes/{{name}}` * * * `{{project}}/{{zone}}/{{name}}` * * * `{{zone}}/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, Vm can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:tpu/v2Vm:V2Vm default projects/{{project}}/locations/{{zone}}/nodes/{{name}} * ``` * * ```sh * $ pulumi import gcp:tpu/v2Vm:V2Vm default {{project}}/{{zone}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:tpu/v2Vm:V2Vm default {{zone}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:tpu/v2Vm:V2Vm default {{name}} * ``` */ class V2Vm extends pulumi.CustomResource { /** * Get an existing V2Vm 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 V2Vm(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of V2Vm. 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'] === V2Vm.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["acceleratorConfig"] = state ? state.acceleratorConfig : undefined; resourceInputs["acceleratorType"] = state ? state.acceleratorType : undefined; resourceInputs["apiVersion"] = state ? state.apiVersion : undefined; resourceInputs["cidrBlock"] = state ? state.cidrBlock : undefined; resourceInputs["dataDisks"] = state ? state.dataDisks : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["health"] = state ? state.health : undefined; resourceInputs["healthDescription"] = state ? state.healthDescription : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; resourceInputs["multisliceNode"] = state ? state.multisliceNode : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["networkConfig"] = state ? state.networkConfig : undefined; resourceInputs["networkConfigs"] = state ? state.networkConfigs : undefined; resourceInputs["networkEndpoints"] = state ? state.networkEndpoints : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["queuedResource"] = state ? state.queuedResource : undefined; resourceInputs["runtimeVersion"] = state ? state.runtimeVersion : undefined; resourceInputs["schedulingConfig"] = state ? state.schedulingConfig : undefined; resourceInputs["serviceAccount"] = state ? state.serviceAccount : undefined; resourceInputs["shieldedInstanceConfig"] = state ? state.shieldedInstanceConfig : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["symptoms"] = state ? state.symptoms : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["zone"] = state ? state.zone : undefined; } else { const args = argsOrState; if ((!args || args.runtimeVersion === undefined) && !opts.urn) { throw new Error("Missing required property 'runtimeVersion'"); } resourceInputs["acceleratorConfig"] = args ? args.acceleratorConfig : undefined; resourceInputs["acceleratorType"] = args ? args.acceleratorType : undefined; resourceInputs["cidrBlock"] = args ? args.cidrBlock : undefined; resourceInputs["dataDisks"] = args ? args.dataDisks : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["metadata"] = args ? args.metadata : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["networkConfig"] = args ? args.networkConfig : undefined; resourceInputs["networkConfigs"] = args ? args.networkConfigs : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["runtimeVersion"] = args ? args.runtimeVersion : undefined; resourceInputs["schedulingConfig"] = args ? args.schedulingConfig : undefined; resourceInputs["serviceAccount"] = args ? args.serviceAccount : undefined; resourceInputs["shieldedInstanceConfig"] = args ? args.shieldedInstanceConfig : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["zone"] = args ? args.zone : undefined; resourceInputs["apiVersion"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["health"] = undefined /*out*/; resourceInputs["healthDescription"] = undefined /*out*/; resourceInputs["multisliceNode"] = undefined /*out*/; resourceInputs["networkEndpoints"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["queuedResource"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["symptoms"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(V2Vm.__pulumiType, name, resourceInputs, opts); } } exports.V2Vm = V2Vm; /** @internal */ V2Vm.__pulumiType = 'gcp:tpu/v2Vm:V2Vm'; //# sourceMappingURL=v2vm.js.map