UNPKG

@pulumi/gcp

Version:

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

82 lines 3.33 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.getV2AcceleratorTypesOutput = exports.getV2AcceleratorTypes = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Get accelerator types available for a project. For more information see the [official documentation](https://cloud.google.com/tpu/docs/) and [API](https://cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.acceleratorTypes). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const available = gcp.tpu.getV2AcceleratorTypes({}); * ``` * * ### Configure Basic TPU VM With Available Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const available = gcp.tpu.getV2AcceleratorTypes({}); * const availableGetV2RuntimeVersions = gcp.tpu.getV2RuntimeVersions({}); * const tpu = new gcp.tpu.V2Vm("tpu", { * name: "test-tpu", * zone: "us-central1-b", * runtimeVersion: availableGetV2RuntimeVersions.then(availableGetV2RuntimeVersions => availableGetV2RuntimeVersions.versions?.[0]), * acceleratorType: available.then(available => available.types?.[0]), * }); * ``` */ function getV2AcceleratorTypes(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("gcp:tpu/getV2AcceleratorTypes:getV2AcceleratorTypes", { "project": args.project, "zone": args.zone, }, opts); } exports.getV2AcceleratorTypes = getV2AcceleratorTypes; /** * Get accelerator types available for a project. For more information see the [official documentation](https://cloud.google.com/tpu/docs/) and [API](https://cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.acceleratorTypes). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const available = gcp.tpu.getV2AcceleratorTypes({}); * ``` * * ### Configure Basic TPU VM With Available Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const available = gcp.tpu.getV2AcceleratorTypes({}); * const availableGetV2RuntimeVersions = gcp.tpu.getV2RuntimeVersions({}); * const tpu = new gcp.tpu.V2Vm("tpu", { * name: "test-tpu", * zone: "us-central1-b", * runtimeVersion: availableGetV2RuntimeVersions.then(availableGetV2RuntimeVersions => availableGetV2RuntimeVersions.versions?.[0]), * acceleratorType: available.then(available => available.types?.[0]), * }); * ``` */ function getV2AcceleratorTypesOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("gcp:tpu/getV2AcceleratorTypes:getV2AcceleratorTypes", { "project": args.project, "zone": args.zone, }, opts); } exports.getV2AcceleratorTypesOutput = getV2AcceleratorTypesOutput; //# sourceMappingURL=getV2AcceleratorTypes.js.map