Skip to content

Commit 5884430

Browse files
dtan4danawillow
authored andcommitted
Add project to container_node_pool import name (GoogleCloudPlatform#1653)
## What As well as hashicorp/terraform-provider-google#1282 , make `resource_container_node_pool` importer accept `{project}/{zone}/{cluster}/{name}` format to specify the project where the node pool belongs to actually. ## Why Sometimes I want to import container pool in different project from default SA's. However, currently there is no way to specify project the target node pool belongs to, Terraform tries to retrieve node pool from SA's project, then it fails due to `You cannot import non-existent resources using Terraform import.` error.
1 parent 00e806b commit 5884430

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/r/container_node_pool.html.markdown

+4-1
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,11 @@ The `management` block supports:
163163

164164
## Import
165165

166-
Node pools can be imported using the `zone`, `cluster` and `name`, e.g.
166+
Node pools can be imported using the `project`, `zone`, `cluster` and `name`. If
167+
the project is omitted, the default provider value will be used. Examples:
167168

168169
```
170+
$ terraform import google_container_node_pool.mainpool my-gcp-project/us-east1-a/my-cluster/main-pool
171+
169172
$ terraform import google_container_node_pool.mainpool us-east1-a/my-cluster/main-pool
170173
```

0 commit comments

Comments
 (0)