Google Cloud TPU Node
This page shows how to write Terraform for Cloud TPU Node and write them securely.
google_tpu_node (Terraform)
The Node in Cloud TPU can be configured in Terraform with the resource name google_tpu_node
. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "google_tpu_node" "this" {
accelerator_type = var.accelerator_type
cidr_block = var.cidr_block
description = var.description
labels = var.labels
name = var.name
Parameters
-
accelerator_type
required - string
The type of hardware accelerators associated with this node.
-
cidr_block
optional computed - 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.
-
description
optional - string
The user-supplied description of the TPU. Maximum of 512 characters.
Resource labels to represent user provided metadata.
-
name
required - string
The immutable name of the TPU.
-
network
optional computed - 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.
-
network_endpoints
optional computed - list of object
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
- string -
port
- number -
project
optional computed - string -
service_account
optional computed - 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.
-
tensorflow_version
required - string
The version of Tensorflow running in the Node.
-
use_service_networking
optional - bool
Whether the VPC peering for the node is set up through Service Networking API. The VPC Peering should be set up before provisioning the node. If this field is set, cidr_block field should not be specified. If the network that you want to peer the TPU Node to is a Shared VPC network, the node must be created with this this field enabled.
-
zone
optional computed - string
The GCP location for the TPU. If it is not provided, the provider zone is used.
-
scheduling_config
list block-
preemptible
required - bool
Defines whether the TPU instance is preemptible.
-
-
timeouts
single block
Explanation in Terraform Registry
A Cloud TPU instance. To get more information about Node, see:
- API documentation
- How-to Guides
Frequently asked questions
What is Google Cloud TPU Node?
Google Cloud TPU Node is a resource for Cloud TPU of Google Cloud Platform. Settings can be wrote in Terraform.
Where can I find the example code for the Google Cloud TPU Node?
For Terraform, the niveklabs/google source code example is useful. See the Terraform Example section for further details.