Module tpu
This page documents the language specification for the gcp package. If you're looking for help working with the inputs, outputs, or functions of gcp resources in a Pulumi program, please see the resource documentation for examples and API reference.
Resources
Functions
Others
Resources
Resource Node
class Node extends CustomResourceA Cloud TPU instance.
To get more information about Node, see:
- API documentation
- How-to Guides
Example Usage - TPU Node Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const available = gcp.tpu.getTensorflowVersions({});
const tpu = new gcp.tpu.Node("tpu", {
zone: "us-central1-b",
acceleratorType: "v3-8",
tensorflowVersion: available.then(available => available.versions[0]),
cidrBlock: "10.2.0.0/29",
});Example Usage - TPU Node Full
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const available = gcp.tpu.getTensorflowVersions({});
const tpu = new gcp.tpu.Node("tpu", {
zone: "us-central1-b",
acceleratorType: "v3-8",
cidrBlock: "10.3.0.0/29",
tensorflowVersion: available.then(available => available.versions[0]),
description: "Google Provider test TPU",
network: "default",
labels: {
foo: "bar",
},
scheduling_config: {
preemptible: true,
},
});constructor
new Node(name: string, args: NodeArgs, opts?: pulumi.CustomResourceOptions)Create a Node resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: NodeState, opts?: pulumi.CustomResourceOptions): NodeGet an existing Node resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is NodeReturns true if the given object is an instance of Node. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property acceleratorType
public acceleratorType: pulumi.Output<string>;The type of hardware accelerators associated with this node.
property cidrBlock
public cidrBlock: 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.
property description
public description: pulumi.Output<string | undefined>;The user-supplied description of the TPU. Maximum of 512 characters.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property labels
public labels: pulumi.Output<{[key: string]: string} | undefined>;Resource labels to represent user provided metadata.
property name
public name: pulumi.Output<string>;The immutable name of the TPU.
property network
public network: pulumi.Output<string>;The name of a network to peer the TPU node to. It must be a preexisting Compute Engine network inside of the project on which this API has been activated. If none is provided, “default” will be used.
property networkEndpoints
public networkEndpoints: pulumi.Output<NodeNetworkEndpoint[]>;The network endpoints where TPU workers can be accessed and sent work. It is recommended that Tensorflow clients of the node first reach out to the first (index 0) entry.
property project
public project: pulumi.Output<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property schedulingConfig
public schedulingConfig: pulumi.Output<NodeSchedulingConfig | undefined>;Sets the scheduling options for this TPU instance. Structure is documented below.
property serviceAccount
public serviceAccount: pulumi.Output<string>;The service account used to run the tensor flow services within the node. To share resources, including Google Cloud Storage data, with the Tensorflow job running in the Node, this account must have permissions to that data.
property tensorflowVersion
public tensorflowVersion: pulumi.Output<string>;The version of Tensorflow running in the Node.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
property zone
public zone: pulumi.Output<string>;The GCP location for the TPU.
Functions
Function getTensorflowVersions
getTensorflowVersions(args?: GetTensorflowVersionsArgs, opts?: pulumi.InvokeOptions): Promise<GetTensorflowVersionsResult>Get TensorFlow versions available for a project. For more information see the official documentation and API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const available = pulumi.output(gcp.tpu.getTensorflowVersions({ async: true }));Example Usage: Configure Basic TPU Node with available version
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const available = gcp.tpu.getTensorflowVersions({});
const tpu = new gcp.tpu.Node("tpu", {
zone: "us-central1-b",
acceleratorType: "v3-8",
tensorflowVersion: available.then(available => available.versions[0]),
cidrBlock: "10.2.0.0/29",
});Others
interface GetTensorflowVersionsArgs
interface GetTensorflowVersionsArgsA collection of arguments for invoking getTensorflowVersions.
property project
project?: undefined | string;The project to list versions for. If it is not provided, the provider project is used.
property zone
zone?: undefined | string;The zone to list versions for. If it is not provided, the provider zone is used.
interface GetTensorflowVersionsResult
interface GetTensorflowVersionsResultA collection of values returned by getTensorflowVersions.
property id
id: string;The provider-assigned unique ID for this managed resource.
property project
project: string;property versions
versions: string[];The list of TensorFlow versions available for the given project and zone.
property zone
zone: string;interface NodeArgs
interface NodeArgsThe set of arguments for constructing a Node resource.
property acceleratorType
acceleratorType: pulumi.Input<string>;The type of hardware accelerators associated with this node.
property cidrBlock
cidrBlock: 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.
property description
description?: pulumi.Input<string>;The user-supplied description of the TPU. Maximum of 512 characters.
property labels
labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;Resource labels to represent user provided metadata.
property name
name?: pulumi.Input<string>;The immutable name of the TPU.
property network
network?: pulumi.Input<string>;The name of a network to peer the TPU node to. It must be a preexisting Compute Engine network inside of the project on which this API has been activated. If none is provided, “default” will be used.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property schedulingConfig
schedulingConfig?: pulumi.Input<NodeSchedulingConfig>;Sets the scheduling options for this TPU instance. Structure is documented below.
property tensorflowVersion
tensorflowVersion: pulumi.Input<string>;The version of Tensorflow running in the Node.
property zone
zone: pulumi.Input<string>;The GCP location for the TPU.
interface NodeState
interface NodeStateInput properties used for looking up and filtering Node resources.
property acceleratorType
acceleratorType?: pulumi.Input<string>;The type of hardware accelerators associated with this node.
property cidrBlock
cidrBlock?: 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.
property description
description?: pulumi.Input<string>;The user-supplied description of the TPU. Maximum of 512 characters.
property labels
labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;Resource labels to represent user provided metadata.
property name
name?: pulumi.Input<string>;The immutable name of the TPU.
property network
network?: pulumi.Input<string>;The name of a network to peer the TPU node to. It must be a preexisting Compute Engine network inside of the project on which this API has been activated. If none is provided, “default” will be used.
property networkEndpoints
networkEndpoints?: pulumi.Input<pulumi.Input<NodeNetworkEndpoint>[]>;The network endpoints where TPU workers can be accessed and sent work. It is recommended that Tensorflow clients of the node first reach out to the first (index 0) entry.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property schedulingConfig
schedulingConfig?: pulumi.Input<NodeSchedulingConfig>;Sets the scheduling options for this TPU instance. Structure is documented below.
property serviceAccount
serviceAccount?: pulumi.Input<string>;The service account used to run the tensor flow services within the node. To share resources, including Google Cloud Storage data, with the Tensorflow job running in the Node, this account must have permissions to that data.
property tensorflowVersion
tensorflowVersion?: pulumi.Input<string>;The version of Tensorflow running in the Node.
property zone
zone?: pulumi.Input<string>;The GCP location for the TPU.