@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
540 lines (539 loc) • 19.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* A Cloud TPU VM instance.
*
* To get more information about Vm, see:
*
* * [API documentation](https://cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/tpu/docs/)
*
* ## 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 "@pulumiverse/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}}
* ```
*/
export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: V2VmState, opts?: pulumi.CustomResourceOptions): V2Vm;
/**
* 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: any): obj is V2Vm;
/**
* The AccleratorConfig for the TPU Node. `acceleratorConfig` cannot be used at the same time
* as `acceleratorType`. If neither is specified, `acceleratorType` defaults to 'v2-8'.
* Structure is documented below.
*/
readonly acceleratorConfig: pulumi.Output<outputs.tpu.V2VmAcceleratorConfig>;
/**
* TPU accelerator type for the TPU. `acceleratorType` cannot be used at the same time as
* `acceleratorConfig`. If neither is specified, `acceleratorType` defaults to 'v2-8'.
*/
readonly acceleratorType: pulumi.Output<string>;
/**
* The API version that created this Node.
*/
readonly apiVersion: pulumi.Output<string>;
/**
* The CIDR block that the TPU node will use when selecting an IP address. This CIDR block must
* be a /29 block; the Compute Engine networks API forbids a smaller block, and using a larger
* block would be wasteful (a node can only consume one IP address). Errors will occur if the
* CIDR block has already been used for a currently existing TPU node, the CIDR block conflicts
* with any subnetworks in the user's provided network, or the provided network is peered with
* another network that is using that CIDR block.
*/
readonly cidrBlock: pulumi.Output<string>;
/**
* The additional data disks for the Node.
* Structure is documented below.
*/
readonly dataDisks: pulumi.Output<outputs.tpu.V2VmDataDisk[] | undefined>;
/**
* Text description of the TPU.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
readonly effectiveLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* The health status of the TPU node.
*/
readonly health: pulumi.Output<string>;
/**
* If this field is populated, it contains a description of why the TPU Node is unhealthy.
*/
readonly healthDescription: pulumi.Output<string>;
/**
* Resource labels to represent user-provided metadata.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
readonly labels: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Custom metadata to apply to the TPU Node. Can set startup-script and shutdown-script.
*/
readonly metadata: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Whether the Node belongs to a Multislice group.
*/
readonly multisliceNode: pulumi.Output<boolean>;
/**
* The immutable name of the TPU.
*/
readonly name: pulumi.Output<string>;
/**
* Network configurations for the TPU node.
* Structure is documented below.
*/
readonly networkConfig: pulumi.Output<outputs.tpu.V2VmNetworkConfig>;
/**
* Repeated network configurations for the TPU node. This field is used to specify multiple
* network configs for the TPU node.
* Structure is documented below.
*/
readonly networkConfigs: pulumi.Output<outputs.tpu.V2VmNetworkConfig[] | undefined>;
/**
* The network endpoints where TPU workers can be accessed and sent work. It is recommended that
* runtime clients of the node reach out to the 0th entry in this map first.
* Structure is documented below.
*/
readonly networkEndpoints: pulumi.Output<outputs.tpu.V2VmNetworkEndpoint[]>;
/**
* 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 combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
readonly pulumiLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* The qualified name of the QueuedResource that requested this Node.
*/
readonly queuedResource: pulumi.Output<string>;
/**
* Runtime version for the TPU.
*/
readonly runtimeVersion: pulumi.Output<string>;
/**
* The scheduling options for this node.
* Structure is documented below.
*/
readonly schedulingConfig: pulumi.Output<outputs.tpu.V2VmSchedulingConfig | undefined>;
/**
* The Google Cloud Platform Service Account to be used by the TPU node VMs. If None is
* specified, the default compute service account will be used.
* Structure is documented below.
*/
readonly serviceAccount: pulumi.Output<outputs.tpu.V2VmServiceAccount>;
/**
* Shielded Instance options.
* Structure is documented below.
*/
readonly shieldedInstanceConfig: pulumi.Output<outputs.tpu.V2VmShieldedInstanceConfig | undefined>;
/**
* The current state for the TPU Node.
*/
readonly state: pulumi.Output<string>;
/**
* The Symptoms that have occurred to the TPU Node.
* Structure is documented below.
*/
readonly symptoms: pulumi.Output<outputs.tpu.V2VmSymptom[]>;
/**
* Tags to apply to the TPU Node. Tags are used to identify valid sources or targets for network firewalls.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* The GCP location for the TPU. If it is not provided, the provider zone is used.
*/
readonly zone: pulumi.Output<string>;
/**
* Create a V2Vm 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: V2VmArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering V2Vm resources.
*/
export interface V2VmState {
/**
* The AccleratorConfig for the TPU Node. `acceleratorConfig` cannot be used at the same time
* as `acceleratorType`. If neither is specified, `acceleratorType` defaults to 'v2-8'.
* Structure is documented below.
*/
acceleratorConfig?: pulumi.Input<inputs.tpu.V2VmAcceleratorConfig>;
/**
* TPU accelerator type for the TPU. `acceleratorType` cannot be used at the same time as
* `acceleratorConfig`. If neither is specified, `acceleratorType` defaults to 'v2-8'.
*/
acceleratorType?: pulumi.Input<string>;
/**
* The API version that created this Node.
*/
apiVersion?: pulumi.Input<string>;
/**
* The CIDR block that the TPU node will use when selecting an IP address. This CIDR block must
* be a /29 block; the Compute Engine networks API forbids a smaller block, and using a larger
* block would be wasteful (a node can only consume one IP address). Errors will occur if the
* CIDR block has already been used for a currently existing TPU node, the CIDR block conflicts
* with any subnetworks in the user's provided network, or the provided network is peered with
* another network that is using that CIDR block.
*/
cidrBlock?: pulumi.Input<string>;
/**
* The additional data disks for the Node.
* Structure is documented below.
*/
dataDisks?: pulumi.Input<pulumi.Input<inputs.tpu.V2VmDataDisk>[]>;
/**
* Text description of the TPU.
*/
description?: pulumi.Input<string>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
effectiveLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The health status of the TPU node.
*/
health?: pulumi.Input<string>;
/**
* If this field is populated, it contains a description of why the TPU Node is unhealthy.
*/
healthDescription?: pulumi.Input<string>;
/**
* Resource labels to represent user-provided metadata.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Custom metadata to apply to the TPU Node. Can set startup-script and shutdown-script.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Whether the Node belongs to a Multislice group.
*/
multisliceNode?: pulumi.Input<boolean>;
/**
* The immutable name of the TPU.
*/
name?: pulumi.Input<string>;
/**
* Network configurations for the TPU node.
* Structure is documented below.
*/
networkConfig?: pulumi.Input<inputs.tpu.V2VmNetworkConfig>;
/**
* Repeated network configurations for the TPU node. This field is used to specify multiple
* network configs for the TPU node.
* Structure is documented below.
*/
networkConfigs?: pulumi.Input<pulumi.Input<inputs.tpu.V2VmNetworkConfig>[]>;
/**
* The network endpoints where TPU workers can be accessed and sent work. It is recommended that
* runtime clients of the node reach out to the 0th entry in this map first.
* Structure is documented below.
*/
networkEndpoints?: pulumi.Input<pulumi.Input<inputs.tpu.V2VmNetworkEndpoint>[]>;
/**
* 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 combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
pulumiLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The qualified name of the QueuedResource that requested this Node.
*/
queuedResource?: pulumi.Input<string>;
/**
* Runtime version for the TPU.
*/
runtimeVersion?: pulumi.Input<string>;
/**
* The scheduling options for this node.
* Structure is documented below.
*/
schedulingConfig?: pulumi.Input<inputs.tpu.V2VmSchedulingConfig>;
/**
* The Google Cloud Platform Service Account to be used by the TPU node VMs. If None is
* specified, the default compute service account will be used.
* Structure is documented below.
*/
serviceAccount?: pulumi.Input<inputs.tpu.V2VmServiceAccount>;
/**
* Shielded Instance options.
* Structure is documented below.
*/
shieldedInstanceConfig?: pulumi.Input<inputs.tpu.V2VmShieldedInstanceConfig>;
/**
* The current state for the TPU Node.
*/
state?: pulumi.Input<string>;
/**
* The Symptoms that have occurred to the TPU Node.
* Structure is documented below.
*/
symptoms?: pulumi.Input<pulumi.Input<inputs.tpu.V2VmSymptom>[]>;
/**
* Tags to apply to the TPU Node. Tags are used to identify valid sources or targets for network firewalls.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The GCP location for the TPU. If it is not provided, the provider zone is used.
*/
zone?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a V2Vm resource.
*/
export interface V2VmArgs {
/**
* The AccleratorConfig for the TPU Node. `acceleratorConfig` cannot be used at the same time
* as `acceleratorType`. If neither is specified, `acceleratorType` defaults to 'v2-8'.
* Structure is documented below.
*/
acceleratorConfig?: pulumi.Input<inputs.tpu.V2VmAcceleratorConfig>;
/**
* TPU accelerator type for the TPU. `acceleratorType` cannot be used at the same time as
* `acceleratorConfig`. If neither is specified, `acceleratorType` defaults to 'v2-8'.
*/
acceleratorType?: pulumi.Input<string>;
/**
* The CIDR block that the TPU node will use when selecting an IP address. This CIDR block must
* be a /29 block; the Compute Engine networks API forbids a smaller block, and using a larger
* block would be wasteful (a node can only consume one IP address). Errors will occur if the
* CIDR block has already been used for a currently existing TPU node, the CIDR block conflicts
* with any subnetworks in the user's provided network, or the provided network is peered with
* another network that is using that CIDR block.
*/
cidrBlock?: pulumi.Input<string>;
/**
* The additional data disks for the Node.
* Structure is documented below.
*/
dataDisks?: pulumi.Input<pulumi.Input<inputs.tpu.V2VmDataDisk>[]>;
/**
* Text description of the TPU.
*/
description?: pulumi.Input<string>;
/**
* Resource labels to represent user-provided metadata.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Custom metadata to apply to the TPU Node. Can set startup-script and shutdown-script.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The immutable name of the TPU.
*/
name?: pulumi.Input<string>;
/**
* Network configurations for the TPU node.
* Structure is documented below.
*/
networkConfig?: pulumi.Input<inputs.tpu.V2VmNetworkConfig>;
/**
* Repeated network configurations for the TPU node. This field is used to specify multiple
* network configs for the TPU node.
* Structure is documented below.
*/
networkConfigs?: pulumi.Input<pulumi.Input<inputs.tpu.V2VmNetworkConfig>[]>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* Runtime version for the TPU.
*/
runtimeVersion: pulumi.Input<string>;
/**
* The scheduling options for this node.
* Structure is documented below.
*/
schedulingConfig?: pulumi.Input<inputs.tpu.V2VmSchedulingConfig>;
/**
* The Google Cloud Platform Service Account to be used by the TPU node VMs. If None is
* specified, the default compute service account will be used.
* Structure is documented below.
*/
serviceAccount?: pulumi.Input<inputs.tpu.V2VmServiceAccount>;
/**
* Shielded Instance options.
* Structure is documented below.
*/
shieldedInstanceConfig?: pulumi.Input<inputs.tpu.V2VmShieldedInstanceConfig>;
/**
* Tags to apply to the TPU Node. Tags are used to identify valid sources or targets for network firewalls.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The GCP location for the TPU. If it is not provided, the provider zone is used.
*/
zone?: pulumi.Input<string>;
}