-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new TPUv2 QueuedResource resource in beta (#12277)
[upstream:67c66d2f33f82fb285fb99aa2b6a63f6a9c9f69e] Signed-off-by: Modular Magician <[email protected]>
- Loading branch information
1 parent
2f6fe52
commit 4c6f1d7
Showing
2 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:new-resource | ||
`google_tpu_v2_queued_resource` (beta) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
--- | ||
# ---------------------------------------------------------------------------- | ||
# | ||
# *** AUTO GENERATED CODE *** Type: MMv1 *** | ||
# | ||
# ---------------------------------------------------------------------------- | ||
# | ||
# 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. | ||
# | ||
# ---------------------------------------------------------------------------- | ||
subcategory: "Cloud TPU v2" | ||
description: |- | ||
A Cloud TPU Queued Resource. | ||
--- | ||
|
||
# google_tpu_v2_queued_resource | ||
|
||
A Cloud TPU Queued Resource. | ||
|
||
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. | ||
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources. | ||
|
||
To get more information about QueuedResource, see: | ||
|
||
* [API documentation](https://cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.queuedResources) | ||
* How-to Guides | ||
* [Official Documentation](https://cloud.google.com/tpu/docs/) | ||
|
||
## Example Usage - Tpu V2 Queued Resource Basic | ||
|
||
|
||
```hcl | ||
resource "google_tpu_v2_queued_resource" "qr" { | ||
provider = google-beta | ||
name = "test-qr" | ||
zone = "us-central1-c" | ||
project = "my-project-name" | ||
tpu { | ||
node_spec { | ||
parent = "projects/my-project-name/locations/us-central1-c" | ||
node_id = "test-tpu" | ||
node { | ||
runtime_version = "tpu-vm-tf-2.13.0" | ||
accelerator_type = "v2-8" | ||
description = "Text description of the TPU." | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
|
||
* `name` - | ||
(Required) | ||
The immutable name of the Queued Resource. | ||
|
||
|
||
- - - | ||
|
||
|
||
* `tpu` - | ||
(Optional) | ||
Defines a TPU resource. | ||
Structure is [documented below](#nested_tpu). | ||
|
||
* `zone` - | ||
(Optional) | ||
The GCP location for the Queued Resource. If it is not provided, the provider zone is used. | ||
|
||
* `project` - (Optional) The ID of the project in which the resource belongs. | ||
If it is not provided, the provider project is used. | ||
|
||
|
||
<a name="nested_tpu"></a>The `tpu` block supports: | ||
|
||
* `node_spec` - | ||
(Optional) | ||
The TPU node(s) being requested. | ||
Structure is [documented below](#nested_node_spec). | ||
|
||
|
||
<a name="nested_node_spec"></a>The `node_spec` block supports: | ||
|
||
* `parent` - | ||
(Required) | ||
The parent resource name. | ||
|
||
* `node_id` - | ||
(Optional) | ||
Unqualified node identifier used to identify the node in the project once provisioned. | ||
|
||
* `node` - | ||
(Required) | ||
The node. | ||
Structure is [documented below](#nested_node). | ||
|
||
|
||
<a name="nested_node"></a>The `node` block supports: | ||
|
||
* `runtime_version` - | ||
(Required) | ||
Runtime version for the TPU. | ||
|
||
* `accelerator_type` - | ||
(Optional) | ||
TPU accelerator type for the TPU. If not specified, this defaults to 'v2-8'. | ||
|
||
* `description` - | ||
(Optional) | ||
Text description of the TPU. | ||
|
||
## Attributes Reference | ||
|
||
In addition to the arguments listed above, the following computed attributes are exported: | ||
|
||
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{zone}}/queuedResources/{{name}}` | ||
|
||
|
||
## Timeouts | ||
|
||
This resource provides the following | ||
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: | ||
|
||
- `create` - Default is 20 minutes. | ||
- `delete` - Default is 20 minutes. | ||
|
||
## Import | ||
|
||
|
||
QueuedResource can be imported using any of these accepted formats: | ||
|
||
* `projects/{{project}}/locations/{{zone}}/queuedResources/{{name}}` | ||
* `{{project}}/{{zone}}/{{name}}` | ||
* `{{zone}}/{{name}}` | ||
* `{{name}}` | ||
|
||
|
||
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: | ||
|
||
```tf | ||
import { | ||
id = "projects/{{project}}/locations/{{zone}}/queuedResources/{{name}}" | ||
to = google_tpu_v2_queued_resource.default | ||
} | ||
``` | ||
|
||
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: | ||
|
||
``` | ||
$ terraform import google_tpu_v2_queued_resource.default projects/{{project}}/locations/{{zone}}/queuedResources/{{name}} | ||
$ terraform import google_tpu_v2_queued_resource.default {{project}}/{{zone}}/{{name}} | ||
$ terraform import google_tpu_v2_queued_resource.default {{zone}}/{{name}} | ||
$ terraform import google_tpu_v2_queued_resource.default {{name}} | ||
``` | ||
|
||
## User Project Overrides | ||
|
||
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override). |