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.

tpu

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-gcp repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-google repo.

class pulumi_gcp.tpu.AwaitableGetTensorflowVersionsResult(id=None, project=None, versions=None, zone=None)
class pulumi_gcp.tpu.GetTensorflowVersionsResult(id=None, project=None, versions=None, zone=None)

A collection of values returned by getTensorflowVersions.

id = None

The provider-assigned unique ID for this managed resource.

versions = None

The list of TensorFlow versions available for the given project and zone.

class pulumi_gcp.tpu.Node(resource_name, opts=None, accelerator_type=None, cidr_block=None, description=None, labels=None, name=None, network=None, project=None, scheduling_config=None, tensorflow_version=None, zone=None, __props__=None, __name__=None, __opts__=None)

A Cloud TPU instance.

To get more information about Node, see:

import pulumi
import pulumi_gcp as gcp

available = gcp.tpu.get_tensorflow_versions()
tpu = gcp.tpu.Node("tpu",
    zone="us-central1-b",
    accelerator_type="v3-8",
    tensorflow_version=available.versions[0],
    cidr_block="10.2.0.0/29")
import pulumi
import pulumi_gcp as gcp

available = gcp.tpu.get_tensorflow_versions()
tpu = gcp.tpu.Node("tpu",
    zone="us-central1-b",
    accelerator_type="v3-8",
    cidr_block="10.3.0.0/29",
    tensorflow_version=available.versions[0],
    description="Google Provider test TPU",
    network="default",
    labels={
        "foo": "bar",
    },
    scheduling_config={
        "preemptible": True,
    })
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • accelerator_type (pulumi.Input[str]) – The type of hardware accelerators associated with this node.

  • cidr_block (pulumi.Input[str]) – 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.

  • description (pulumi.Input[str]) – The user-supplied description of the TPU. Maximum of 512 characters.

  • labels (pulumi.Input[dict]) – Resource labels to represent user provided metadata.

  • name (pulumi.Input[str]) – The immutable name of the TPU.

  • network (pulumi.Input[str]) – 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.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • scheduling_config (pulumi.Input[dict]) – Sets the scheduling options for this TPU instance. Structure is documented below.

  • tensorflow_version (pulumi.Input[str]) – The version of Tensorflow running in the Node.

  • zone (pulumi.Input[str]) – The GCP location for the TPU.

The scheduling_config object supports the following:

  • preemptible (pulumi.Input[bool]) - Defines whether the TPU instance is preemptible.

accelerator_type: pulumi.Output[str] = None

The type of hardware accelerators associated with this node.

cidr_block: pulumi.Output[str] = None

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.

description: pulumi.Output[str] = None

The user-supplied description of the TPU. Maximum of 512 characters.

labels: pulumi.Output[dict] = None

Resource labels to represent user provided metadata.

name: pulumi.Output[str] = None

The immutable name of the TPU.

network: pulumi.Output[str] = None

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.

network_endpoints: pulumi.Output[list] = None

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.

  • ip_address (str)

  • port (float)

project: pulumi.Output[str] = None

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

scheduling_config: pulumi.Output[dict] = None

Sets the scheduling options for this TPU instance. Structure is documented below.

  • preemptible (bool) - Defines whether the TPU instance is preemptible.

service_account: pulumi.Output[str] = None

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.

tensorflow_version: pulumi.Output[str] = None

The version of Tensorflow running in the Node.

zone: pulumi.Output[str] = None

The GCP location for the TPU.

static get(resource_name, id, opts=None, accelerator_type=None, cidr_block=None, description=None, labels=None, name=None, network=None, network_endpoints=None, project=None, scheduling_config=None, service_account=None, tensorflow_version=None, zone=None)

Get an existing Node resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • accelerator_type (pulumi.Input[str]) – The type of hardware accelerators associated with this node.

  • cidr_block (pulumi.Input[str]) – 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.

  • description (pulumi.Input[str]) – The user-supplied description of the TPU. Maximum of 512 characters.

  • labels (pulumi.Input[dict]) – Resource labels to represent user provided metadata.

  • name (pulumi.Input[str]) – The immutable name of the TPU.

  • network (pulumi.Input[str]) – 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.

  • network_endpoints (pulumi.Input[list]) – 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.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • scheduling_config (pulumi.Input[dict]) – Sets the scheduling options for this TPU instance. Structure is documented below.

  • service_account (pulumi.Input[str]) – 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.

  • tensorflow_version (pulumi.Input[str]) – The version of Tensorflow running in the Node.

  • zone (pulumi.Input[str]) – The GCP location for the TPU.

The network_endpoints object supports the following:

  • ip_address (pulumi.Input[str])

  • port (pulumi.Input[float])

The scheduling_config object supports the following:

  • preemptible (pulumi.Input[bool]) - Defines whether the TPU instance is preemptible.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

pulumi_gcp.tpu.get_tensorflow_versions(project=None, zone=None, opts=None)

Get TensorFlow versions available for a project. For more information see the official documentation and API.

import pulumi
import pulumi_gcp as gcp

available = gcp.tpu.get_tensorflow_versions()
import pulumi
import pulumi_gcp as gcp

available = gcp.tpu.get_tensorflow_versions()
tpu = gcp.tpu.Node("tpu",
    zone="us-central1-b",
    accelerator_type="v3-8",
    tensorflow_version=available.versions[0],
    cidr_block="10.2.0.0/29")
Parameters
  • project (str) – The project to list versions for. If it is not provided, the provider project is used.

  • zone (str) – The zone to list versions for. If it is not provided, the provider zone is used.