Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add info about plannable import to handwritten documentation (non-IAM resources), Part 2 #6440

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/9100.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
21 changes: 18 additions & 3 deletions website/docs/r/container_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -1338,12 +1338,27 @@ This resource provides the following
GKE clusters can be imported using the `project` , `location`, and `name`. If the project is omitted, the default
provider value will be used. Examples:

* `projects/{{project_id}}/locations/{{location}}/clusters/{{cluster_id}}`
* `{{project_id}}/{{location}}/{{cluster_id}}`
* `{{location}}/{{cluster_id}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import GKE clusters using one of the formats above. For example:

```tf
import {
id = "projects/{{project_id}}/locations/{{location}}/clusters/{{cluster_id}}"
to = google_container_cluster.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), GKE clusters can be imported using one of the formats above. For example:

```
$ terraform import google_container_cluster.mycluster projects/my-gcp-project/locations/us-east1-a/clusters/my-cluster
$ terraform import google_container_cluster.default projects/{{project_id}}/locations/{{location}}/clusters/{{cluster_id}}

$ terraform import google_container_cluster.mycluster my-gcp-project/us-east1-a/my-cluster
$ terraform import google_container_cluster.default {{project_id}}/{{location}}/{{cluster_id}}

$ terraform import google_container_cluster.mycluster us-east1-a/my-cluster
$ terraform import google_container_cluster.default {{location}}/{{cluster_id}}
```

~> **Note:** This resource has several fields that control Terraform-specific behavior and aren't present in the API. If they are set in config and you import a cluster, Terraform may need to perform an update immediately after import. Most of these updates should be no-ops but some may modify your cluster if the imported state differs.
Expand Down
18 changes: 16 additions & 2 deletions website/docs/r/container_node_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,22 @@ In addition to the arguments listed above, the following computed attributes are
Node pools can be imported using the `project`, `location`, `cluster` and `name`. If
the project is omitted, the project value in the provider configuration will be used. Examples:

* `{{project_id}}/{{location}}/{{cluster_id}}/{{pool_id}}`
* `{{location}}/{{cluster_id}}/{{pool_id}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import node pools using one of the formats above. For example:

```tf
import {
id = "{{project_id}}/{{location}}/{{cluster_id}}/{{pool_id}}"
to = google_container_node_pool.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), node pools can be imported using one of the formats above. For example:

```
$ terraform import google_container_node_pool.mainpool my-gcp-project/us-east1-a/my-cluster/main-pool
$ terraform import google_container_node_pool.default {{project_id}}/{{location}}/{{cluster_id}}/{{pool_id}}

$ terraform import google_container_node_pool.mainpool us-east1/my-cluster/main-pool
$ terraform import google_container_node_pool.default {{location}}/{{cluster_id}}/{{pool_id}}
```
15 changes: 14 additions & 1 deletion website/docs/r/dataflow_job.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@ The following arguments are supported:

Dataflow jobs can be imported using the job `id` e.g.

* `{{id}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import dataflow jobs using one of the formats above. For example:

```tf
import {
id = "{{id}}"
to = google_dataflow_job.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), dataflow jobs can be imported using one of the formats above. For example:

```
$ terraform import google_dataflow_job.example 2022-07-31_06_25_42-11926927532632678660
$ terraform import google_dataflow_job.default {{id}}
```
15 changes: 15 additions & 0 deletions website/docs/r/dataproc_workflow_template.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,21 @@ This resource provides the following

WorkflowTemplate can be imported using any of these accepted formats:

* `projects/{{project}}/locations/{{location}}/workflowTemplates/{{name}}`
* `{{project}}/{{location}}/{{name}}`
* `{{location}}/{{name}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import WorkflowTemplate using one of the formats above. For example:

```tf
import {
id = "projects/{{project}}/locations/{{location}}/workflowTemplates/{{name}}"
to = google_dataproc_workflow_template.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), WorkflowTemplate can be imported using one of the formats above. For example:

```
$ terraform import google_dataproc_workflow_template.default projects/{{project}}/locations/{{location}}/workflowTemplates/{{name}}
$ terraform import google_dataproc_workflow_template.default {{project}}/{{location}}/{{name}}
Expand Down
14 changes: 14 additions & 0 deletions website/docs/r/dialogflow_cx_environment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ This resource provides the following

Environment can be imported using any of these accepted formats:

* `{{parent}}/environments/{{name}}`
* `{{parent}}/{{name}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Environment using one of the formats above. For example:

```tf
import {
id = "{{parent}}/environments/{{name}}"
to = google_dialogflow_cx_environment.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Environment can be imported using one of the formats above. For example:

```
$ terraform import google_dialogflow_cx_environment.default {{parent}}/environments/{{name}}
$ terraform import google_dialogflow_cx_environment.default {{parent}}/{{name}}
Expand Down
15 changes: 14 additions & 1 deletion website/docs/r/dialogflow_cx_version.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,22 @@ This resource provides the following

## Import


Version can be imported using any of these accepted formats:

* `{{parent}}/versions/{{name}}`
* `{{parent}}/{{name}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Version using one of the formats above. For example:

```tf
import {
id = "{{parent}}/versions/{{name}}"
to = google_dialogflow_cx_version.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Version can be imported using one of the formats above. For example:

```
$ terraform import google_dialogflow_cx_version.default {{parent}}/versions/{{name}}
$ terraform import google_dialogflow_cx_version.default {{parent}}/{{name}}
Expand Down
21 changes: 18 additions & 3 deletions website/docs/r/dns_record_set.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,25 @@ The following arguments are supported:

DNS record sets can be imported using either of these accepted formats:

* `projects/{{project}}/managedZones/{{zone}}/rrsets/{{name}}/{{type}}`
* `{{project}}/{{zone}}/{{name}}/{{type}}`
* `{{zone}}/{{name}}/{{type}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import DNS record sets using one of the formats above. For example:

```tf
import {
id = "projects/{{project}}/managedZones/{{zone}}/rrsets/{{name}}/{{type}}"
to = google_dns_record_set.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), DNS record sets can be imported using one of the formats above. For example:

```
$ terraform import google_dns_record_set.frontend projects/{{project}}/managedZones/{{zone}}/rrsets/{{name}}/{{type}}
$ terraform import google_dns_record_set.frontend {{project}}/{{zone}}/{{name}}/{{type}}
$ terraform import google_dns_record_set.frontend {{zone}}/{{name}}/{{type}}
$ terraform import google_dns_record_set.default projects/{{project}}/managedZones/{{zone}}/rrsets/{{name}}/{{type}}
$ terraform import google_dns_record_set.default {{project}}/{{zone}}/{{name}}/{{type}}
$ terraform import google_dns_record_set.default {{zone}}/{{name}}/{{type}}
```

Note: The record name must include the trailing dot at the end.
15 changes: 15 additions & 0 deletions website/docs/r/gke_hub_feature_membership.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,21 @@ This resource provides the following

FeatureMembership can be imported using any of these accepted formats:

* `projects/{{project}}/locations/{{location}}/features/{{feature}}/membershipId/{{membership}}`
* `{{project}}/{{location}}/{{feature}}/{{membership}}`
* `{{location}}/{{feature}}/{{membership}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import FeatureMembership using one of the formats above. For example:

```tf
import {
id = "projects/{{project}}/locations/{{location}}/features/{{feature}}/membershipId/{{membership}}"
to = google_gke_hub_feature_membership.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), FeatureMembership can be imported using one of the formats above. For example:

```
$ terraform import google_gke_hub_feature_membership.default projects/{{project}}/locations/{{location}}/features/{{feature}}/membershipId/{{membership}}
$ terraform import google_gke_hub_feature_membership.default {{project}}/{{location}}/{{feature}}/{{membership}}
Expand Down
13 changes: 13 additions & 0 deletions website/docs/r/google_billing_subaccount.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ The following additional attributes are exported:

Billing Subaccounts can be imported using any of these accepted formats:

* `billingAccounts/{billing_account_id}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Billing Subaccounts using one of the formats above. For example:

```tf
import {
id = "billingAccounts/{billing_account_id}"
to = google_billing_subaccount.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Billing Subaccounts can be imported using one of the formats above. For example:

```
$ terraform import google_billing_subaccount.default billingAccounts/{billing_account_id}
```
19 changes: 16 additions & 3 deletions website/docs/r/google_folder.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,21 @@ exported:

Folders can be imported using the folder's id, e.g.

* `folders/{{folder_id}}`
* `{{folder_id}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Folders using one of the formats above. For example:

```tf
import {
id = "folders/{{folder_id}}"
to = google_folder.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Folders can be imported using one of the formats above. For example:

```
# Both syntaxes are valid
$ terraform import google_folder.department1 1234567
$ terraform import google_folder.department1 folders/1234567
$ terraform import google_folder.default {{folder_id}}
$ terraform import google_folder.default folders/{{folder_id}}
```
18 changes: 16 additions & 2 deletions website/docs/r/google_folder_organization_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,21 @@ exported:

Folder organization policies can be imported using any of the follow formats:

* `folders/{{folder_id}}/constraints/serviceuser.services`
* `{{folder_id}}/serviceuser.services`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import folder organization policies using one of the formats above. For example:

```tf
import {
id = "folders/{{folder_id}}/constraints/serviceuser.services"
to = google_folder_organization_policy.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), folder organization policies can be imported using one of the formats above. For example:

```
$ terraform import google_folder_organization_policy.policy folders/folder-1234/constraints/serviceuser.services
$ terraform import google_folder_organization_policy.policy folder-1234/serviceuser.services
* `$ terraform import google_folder_organization_policy.default folders/* ``{{folder_id}}/constraints/serviceuser.services`
* `* `$ terraform import google_folder_organization_policy.default {{folder_id}}/``serviceuser.services
```
15 changes: 14 additions & 1 deletion website/docs/r/google_organization_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,21 @@ exported:

Organization Policies can be imported using the `org_id` and the `constraint`, e.g.

* `{{org_id}}/constraints/{{constraint}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Organization Policies using one of the formats above. For example:

```tf
import {
id = "{{org_id}}/constraints/{{constraint}}"
to = google_organization_policy.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Organization Policies can be imported using one of the formats above. For example:

```
$ terraform import google_organization_policy.services_policy 123456789/constraints/serviceuser.services
$ terraform import google_organization_policy.default {{org_id}}/constraints/{{constraint}}
```

It is all right if the constraint contains a slash, as in the example above.
15 changes: 14 additions & 1 deletion website/docs/r/google_project.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@ This resource provides the following

Projects can be imported using the `project_id`, e.g.

* `{{project_id}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Projects using one of the formats above. For example:

```tf
import {
id = "{{project_id}}"
to = google_project.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Projects can be imported using one of the formats above. For example:

```
$ terraform import google_project.my_project your-project-id
$ terraform import google_project.default {{project_id}}
```
16 changes: 15 additions & 1 deletion website/docs/r/google_project_iam_custom_role.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,23 @@ exported:

## Import


Custom Roles can be imported using any of these accepted formats:

* `projects/{{project}}/roles/{{role_id}}`
* `{{project}}/{{role_id}}`
* `{{role_id}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Custom Roles using one of the formats above. For example:

```tf
import {
id = "projects/{{project}}/roles/{{role_id}}"
to = google_project_iam_custom_role.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Custom Roles can be imported using one of the formats above. For example:

```
$ terraform import google_project_iam_custom_role.default projects/{{project}}/roles/{{role_id}}
$ terraform import google_project_iam_custom_role.default {{project}}/{{role_id}}
Expand Down
21 changes: 18 additions & 3 deletions website/docs/r/google_project_organization_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,23 @@ exported:

Project organization policies can be imported using any of the follow formats:

* `projects/{{project_id}}:constraints/{{constraint}}`
* `{{project_id}}:constraints/{{constraint}}`
* `{{project_id}}:{{constraint}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import project organization policies using one of the formats above. For example:

```tf
import {
id = "projects/{{project_id}}:constraints/{{constraint}}"
to = google_project_organization_policy.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), project organization policies can be imported using one of the formats above. For example:

```
$ terraform import google_project_organization_policy.policy projects/test-project:constraints/serviceuser.services
$ terraform import google_project_organization_policy.policy test-project:constraints/serviceuser.services
$ terraform import google_project_organization_policy.policy test-project:serviceuser.services
$ terraform import google_project_organization_policy.default projects/{{project_id}}:constraints/{{constraint}}
$ terraform import google_project_organization_policy.default {{project_id}}:constraints/{{constraint}}
$ terraform import google_project_organization_policy.default {{project_id}}:{{constraint}}
```
15 changes: 14 additions & 1 deletion website/docs/r/google_project_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,21 @@ This resource provides the following

Project services can be imported using the `project_id` and `service`, e.g.

* `{{project_id}}/{{service}}`

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import project services using one of the formats above. For example:

```tf
import {
id = "{{project_id}}/{{service}}"
to = google_project_service.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), project services can be imported using one of the formats above. For example:

```
$ terraform import google_project_service.my_project your-project-id/iam.googleapis.com
$ terraform import google_project_service.default {{project_id}}/{{service}}
```

Note that unlike other resources that fail if they already exist,
Expand Down
Loading