@@ -54,6 +54,54 @@ resource "google_tpu_v2_queued_resource" "qr" {
54
54
}
55
55
}
56
56
```
57
+ ## Example Usage - Tpu V2 Queued Resource Full
58
+
59
+
60
+ ``` hcl
61
+ resource "google_tpu_v2_queued_resource" "qr" {
62
+ provider = google-beta
63
+
64
+ name = "test-qr"
65
+ zone = "us-central1-c"
66
+ project = "my-project-name"
67
+
68
+ tpu {
69
+ node_spec {
70
+ parent = "projects/my-project-name/locations/us-central1-c"
71
+ node_id = "test-tpu"
72
+ node {
73
+ runtime_version = "tpu-vm-tf-2.13.0"
74
+ accelerator_type = "v2-8"
75
+ description = "Text description of the TPU."
76
+
77
+ network_config {
78
+ can_ip_forward = true
79
+ enable_external_ips = true
80
+ network = google_compute_network.network.id
81
+ subnetwork = google_compute_subnetwork.subnet.id
82
+ queue_count = 32
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+
89
+ resource "google_compute_subnetwork" "subnet" {
90
+ provider = google-beta
91
+
92
+ name = "tpu-subnet"
93
+ ip_cidr_range = "10.0.0.0/16"
94
+ region = "us-central1"
95
+ network = google_compute_network.network.id
96
+ }
97
+
98
+ resource "google_compute_network" "network" {
99
+ provider = google-beta
100
+
101
+ name = "tpu-net"
102
+ auto_create_subnetworks = false
103
+ }
104
+ ```
57
105
58
106
## Argument Reference
59
107
@@ -119,6 +167,38 @@ The following arguments are supported:
119
167
(Optional)
120
168
Text description of the TPU.
121
169
170
+ * ` network_config ` -
171
+ (Optional)
172
+ Network configurations for the TPU node.
173
+ Structure is [ documented below] ( #nested_tpu_node_spec_node_spec_node_network_config ) .
174
+
175
+
176
+ <a name =" nested_tpu_node_spec_node_spec_node_network_config " ></a >The ` network_config ` block supports:
177
+
178
+ * ` network ` -
179
+ (Optional)
180
+ The name of the network for the TPU node. It must be a preexisting Google Compute Engine
181
+ network. If none is provided, "default" will be used.
182
+
183
+ * ` subnetwork ` -
184
+ (Optional)
185
+ The name of the subnetwork for the TPU node. It must be a preexisting Google Compute
186
+ Engine subnetwork. If none is provided, "default" will be used.
187
+
188
+ * ` enable_external_ips ` -
189
+ (Optional)
190
+ Indicates that external IP addresses would be associated with the TPU workers. If set to
191
+ false, the specified subnetwork or network should have Private Google Access enabled.
192
+
193
+ * ` can_ip_forward ` -
194
+ (Optional)
195
+ Allows the TPU node to send and receive packets with non-matching destination or source
196
+ IPs. This is required if you plan to use the TPU workers to forward routes.
197
+
198
+ * ` queue_count ` -
199
+ (Optional)
200
+ Specifies networking queue count for TPU VM instance's network interface.
201
+
122
202
## Attributes Reference
123
203
124
204
In addition to the arguments listed above, the following computed attributes are exported:
0 commit comments