terraform-provider-google/website/docs/r/tpu_node.html.markdown

201 lines
6.2 KiB
Markdown
Raw Normal View History

---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
layout: "google"
page_title: "Google: google_tpu_node"
sidebar_current: "docs-google-tpu-node"
description: |-
A Cloud TPU instance.
---
# google\_tpu\_node
A Cloud TPU instance.
To get more information about Node, see:
* [API documentation](https://cloud.google.com/tpu/docs/reference/rest/)
* How-to Guides
* [Official Documentation](https://cloud.google.com/tpu/docs/)
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=tpu_node_basic&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Tpu Node Basic
```hcl
data "google_tpu_tensorflow_versions" "available" { }
resource "google_tpu_node" "tpu" {
name = "test-tpu"
zone = "us-central1-b"
accelerator_type = "v3-8"
tensorflow_version = "${data.google_tpu_tensorflow_versions.available.versions[0]}"
cidr_block = "10.2.0.0/29"
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=tpu_node_full&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Tpu Node Full
```hcl
resource "google_compute_network" "tpu_network" {
name = "test-tpu-network"
auto_create_subnetworks = false
}
data "google_tpu_tensorflow_versions" "available" { }
resource "google_tpu_node" "tpu" {
name = "test-tpu"
zone = "us-central1-b"
accelerator_type = "v3-8"
cidr_block = "10.3.0.0/29"
tensorflow_version = "${data.google_tpu_tensorflow_versions.available.versions[0]}"
description = "Terraform Google Provider test TPU"
network = "${google_compute_network.tpu_network.name}"
labels = {
foo = "bar"
}
scheduling_config {
preemptible = true
}
}
```
## Argument Reference
The following arguments are supported:
* `name` -
(Required)
The immutable name of the TPU.
* `accelerator_type` -
(Required)
The type of hardware accelerators associated with this node.
* `tensorflow_version` -
(Required)
The version of Tensorflow running in the Node.
* `cidr_block` -
(Required)
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.
* `zone` -
(Required)
The GCP location for the TPU.
- - -
* `description` -
(Optional)
The user-supplied description of the TPU. Maximum of 512 characters.
* `network` -
(Optional)
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.
* `scheduling_config` -
(Optional)
Sets the scheduling options for this TPU instance. Structure is documented below.
* `labels` -
(Optional)
Resource labels to represent user provided metadata.
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
The `scheduling_config` block supports:
* `preemptible` -
(Optional)
Defines whether the TPU instance is preemptible.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `service_account` -
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.
* `network_endpoints` -
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. Structure is documented below.
The `network_endpoints` block contains:
* `ip_address` -
The IP address of this network endpoint.
* `port` -
The port of this network endpoint.
## Timeouts
This resource provides the following
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
- `create` - Default is 15 minutes.
- `update` - Default is 15 minutes.
- `delete` - Default is 15 minutes.
## Import
Node can be imported using any of these accepted formats:
```
$ terraform import google_tpu_node.default projects/{{project}}/locations/{{zone}}/nodes/{{name}}
$ terraform import google_tpu_node.default {{project}}/{{zone}}/{{name}}
$ terraform import google_tpu_node.default {{name}}
```
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.