Skip to content

Commit 5a7f491

Browse files
Add new TPUv2 QueuedResource resource in beta (#12277) (#20443)
[upstream:67c66d2f33f82fb285fb99aa2b6a63f6a9c9f69e] Signed-off-by: Modular Magician <[email protected]>
1 parent 2f6fe52 commit 5a7f491

File tree

2 files changed

+171
-0
lines changed

2 files changed

+171
-0
lines changed

.changelog/12277.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
`google_tpu_v2_queued_resource` (beta)
3+
```
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
---
2+
# ----------------------------------------------------------------------------
3+
#
4+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
5+
#
6+
# ----------------------------------------------------------------------------
7+
#
8+
# This file is automatically generated by Magic Modules and manual
9+
# changes will be clobbered when the file is regenerated.
10+
#
11+
# Please read more about how to change this file in
12+
# .github/CONTRIBUTING.md.
13+
#
14+
# ----------------------------------------------------------------------------
15+
subcategory: "Cloud TPU v2"
16+
description: |-
17+
A Cloud TPU Queued Resource.
18+
---
19+
20+
# google_tpu_v2_queued_resource
21+
22+
A Cloud TPU Queued Resource.
23+
24+
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
25+
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
26+
27+
To get more information about QueuedResource, see:
28+
29+
* [API documentation](https://cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.queuedResources)
30+
* How-to Guides
31+
* [Official Documentation](https://cloud.google.com/tpu/docs/)
32+
33+
## Example Usage - Tpu V2 Queued Resource Basic
34+
35+
36+
```hcl
37+
resource "google_tpu_v2_queued_resource" "qr" {
38+
provider = google-beta
39+
40+
name = "test-qr"
41+
zone = "us-central1-c"
42+
project = "my-project-name"
43+
44+
tpu {
45+
node_spec {
46+
parent = "projects/my-project-name/locations/us-central1-c"
47+
node_id = "test-tpu"
48+
node {
49+
runtime_version = "tpu-vm-tf-2.13.0"
50+
accelerator_type = "v2-8"
51+
description = "Text description of the TPU."
52+
}
53+
}
54+
}
55+
}
56+
```
57+
58+
## Argument Reference
59+
60+
The following arguments are supported:
61+
62+
63+
* `name` -
64+
(Required)
65+
The immutable name of the Queued Resource.
66+
67+
68+
- - -
69+
70+
71+
* `tpu` -
72+
(Optional)
73+
Defines a TPU resource.
74+
Structure is [documented below](#nested_tpu).
75+
76+
* `zone` -
77+
(Optional)
78+
The GCP location for the Queued Resource. If it is not provided, the provider zone is used.
79+
80+
* `project` - (Optional) The ID of the project in which the resource belongs.
81+
If it is not provided, the provider project is used.
82+
83+
84+
<a name="nested_tpu"></a>The `tpu` block supports:
85+
86+
* `node_spec` -
87+
(Optional)
88+
The TPU node(s) being requested.
89+
Structure is [documented below](#nested_node_spec).
90+
91+
92+
<a name="nested_node_spec"></a>The `node_spec` block supports:
93+
94+
* `parent` -
95+
(Required)
96+
The parent resource name.
97+
98+
* `node_id` -
99+
(Optional)
100+
Unqualified node identifier used to identify the node in the project once provisioned.
101+
102+
* `node` -
103+
(Required)
104+
The node.
105+
Structure is [documented below](#nested_node).
106+
107+
108+
<a name="nested_node"></a>The `node` block supports:
109+
110+
* `runtime_version` -
111+
(Required)
112+
Runtime version for the TPU.
113+
114+
* `accelerator_type` -
115+
(Optional)
116+
TPU accelerator type for the TPU. If not specified, this defaults to 'v2-8'.
117+
118+
* `description` -
119+
(Optional)
120+
Text description of the TPU.
121+
122+
## Attributes Reference
123+
124+
In addition to the arguments listed above, the following computed attributes are exported:
125+
126+
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{zone}}/queuedResources/{{name}}`
127+
128+
129+
## Timeouts
130+
131+
This resource provides the following
132+
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
133+
134+
- `create` - Default is 20 minutes.
135+
- `delete` - Default is 20 minutes.
136+
137+
## Import
138+
139+
140+
QueuedResource can be imported using any of these accepted formats:
141+
142+
* `projects/{{project}}/locations/{{zone}}/queuedResources/{{name}}`
143+
* `{{project}}/{{zone}}/{{name}}`
144+
* `{{zone}}/{{name}}`
145+
* `{{name}}`
146+
147+
148+
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import QueuedResource using one of the formats above. For example:
149+
150+
```tf
151+
import {
152+
id = "projects/{{project}}/locations/{{zone}}/queuedResources/{{name}}"
153+
to = google_tpu_v2_queued_resource.default
154+
}
155+
```
156+
157+
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), QueuedResource can be imported using one of the formats above. For example:
158+
159+
```
160+
$ terraform import google_tpu_v2_queued_resource.default projects/{{project}}/locations/{{zone}}/queuedResources/{{name}}
161+
$ terraform import google_tpu_v2_queued_resource.default {{project}}/{{zone}}/{{name}}
162+
$ terraform import google_tpu_v2_queued_resource.default {{zone}}/{{name}}
163+
$ terraform import google_tpu_v2_queued_resource.default {{name}}
164+
```
165+
166+
## User Project Overrides
167+
168+
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).

0 commit comments

Comments
 (0)