Fix documentation around iam member imports (#2865)

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2019-01-11 17:23:56 -08:00 committed by emily
parent d36fbb5ac6
commit 5845ae4d38
11 changed files with 31 additions and 23 deletions

View File

@ -36,7 +36,7 @@ func iamMemberImport(resourceIdParser resourceIdParserFunc) schema.StateFunc {
s := strings.Fields(d.Id())
if len(s) != 3 {
d.SetId("")
return nil, fmt.Errorf("Wrong number of parts to Member id %s; expected 'resource_name role username'.", s)
return nil, fmt.Errorf("Wrong number of parts to Member id %s; expected 'resource_name role member'.", s)
}
id, role, member := s[0], s[1], s[2]

View File

@ -107,10 +107,10 @@ For all import syntaxes, the "resource in question" can take any of the followin
* {{region}}/{{name}} (project is taken from provider project)
* {{name}} (project and region are taken from provider project)
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account, e.g.
IAM member imports use space-delimited identifiers; the resource in question, the role, and the member identity, e.g.
```
$ terraform import google_compute_subnetwork_iam_member.subnet "project-name/region-name/subnetwork-name roles/compute.networkUser foo@example.com"
$ terraform import google_compute_subnetwork_iam_member.subnet "project-name/region-name/subnetwork-name roles/compute.networkUser user:foo@example.com"
```
IAM binding imports use space-delimited identifiers; the resource in question and the role, e.g.

View File

@ -44,8 +44,8 @@ exported:
## Import
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the `billing_account_id`, role, and account e.g.
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the `billing_account_id`, role, and member identity, e.g.
```
$ terraform import google_billing_account_iam_member.binding "your-billing-account-id roles/viewer foo@example.com"
$ terraform import google_billing_account_iam_member.binding "your-billing-account-id roles/viewer user:foo@example.com"
```

View File

@ -56,8 +56,8 @@ exported:
## Import
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the `folder`, role, and account e.g.
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the `folder`, role, and member identity e.g.
```
$ terraform import google_folder_iam_member.my_project "folder-name roles/viewer foo@example.com"
$ terraform import google_folder_iam_member.my_project "folder-name roles/viewer user:foo@example.com"
```

View File

@ -49,8 +49,8 @@ exported:
## Import
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the `crypto_key_id`, role, and account e.g.
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the `crypto_key_id`, role, and member identity e.g.
```
$ terraform import google_kms_crypto_key_iam_member.member "your-project-id/location-name/key-name roles/viewer foo@example.com"
$ terraform import google_kms_crypto_key_iam_member.member "your-project-id/location-name/key-name roles/viewer user:foo@example.com"
```

View File

@ -97,10 +97,10 @@ exported:
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the `key_ring_id`, role, and account e.g.
```
$ terraform import google_kms_key_ring_iam_member.key_ring_iam "your-project-id/location-name/key-ring-name roles/viewer foo@example.com"
$ terraform import google_kms_key_ring_iam_member.key_ring_iam "your-project-id/location-name/key-ring-name roles/viewer user:foo@example.com"
```
IAM binding imports use space-delimited identifiers; the resource in question and the role. This binding resource can be imported using the `key_ring_id`, role, and account e.g.
IAM binding imports use space-delimited identifiers; the resource in question and the role. This binding resource can be imported using the `key_ring_id` and role, e.g.
```
$ terraform import google_kms_key_ring_iam_binding.key_ring_iam "your-project-id/location-name/key-ring-name roles/viewer"

View File

@ -45,8 +45,8 @@ exported:
## Import
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the `org_id`, role, and account e.g.
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the `org_id`, role, and member identity, e.g.
```
$ terraform import google_organization_iam_member.my_org "your-org-id roles/viewer foo@example.com"
$ terraform import google_organization_iam_member.my_org "your-org-id roles/viewer user:foo@example.com"
```

View File

@ -108,12 +108,20 @@ exported:
## Import
IAM resources can be imported using the `project_id`, role, and account.
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the `project_id`, role, and member e.g.
```
$ terraform import google_project_iam_member.my_project "your-project-id roles/viewer user:user:foo@example.com"
```
IAM binding imports use space-delimited identifiers; the resource in question and the role. This binding resource can be imported using the `project_id` and role, e.g.
```
terraform import google_project_iam_binding.my_project "your-project-id roles/viewer"
```
IAM policy imports use the identifier of the resource in question. This policy resource can be imported using the `project_id`.
```
$ terraform import google_project_iam_policy.my_project your-project-id
$ terraform import google_project_iam_binding.my_project "your-project-id roles/viewer"
$ terraform import google_project_iam_member.my_project "your-project-id roles/viewer foo@example.com"
```

View File

@ -118,12 +118,12 @@ exported:
## Import
Service account IAM resources can be imported using the project, service account email, role and member.
Service account IAM resources can be imported using the project, service account email, role and member identity.
```
$ terraform import google_service_account_iam_policy.admin-account-iam projects/{your-project-id}/serviceAccounts/{your-service-account-email}
$ terraform import google_service_account_iam_binding.admin-account-iam "projects/{your-project-id}/serviceAccounts/{your-service-account-email} roles/editor"
$ terraform import google_service_account_iam_member.admin-account-iam "projects/{your-project-id}/serviceAccounts/{your-service-account-email} roles/editor foo@example.com"
$ terraform import google_service_account_iam_member.admin-account-iam "projects/{your-project-id}/serviceAccounts/{your-service-account-email} roles/editor user:foo@example.com"
```

View File

@ -107,10 +107,10 @@ For all import syntaxes, the "resource in question" can take any of the followin
* {{project}}/{{instance}}/{{database}}
* {{instance}}/{{database}} (project is taken from provider project)
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account, e.g.
IAM member imports use space-delimited identifiers; the resource in question, the role, and the member identity, e.g.
```
$ terraform import google_spanner_database_iam_member.database "project-name/instance-name/database-name roles/viewer foo@example.com"
$ terraform import google_spanner_database_iam_member.database "project-name/instance-name/database-name roles/viewer user:foo@example.com"
```
IAM binding imports use space-delimited identifiers; the resource in question and the role, e.g.

View File

@ -105,7 +105,7 @@ For all import syntaxes, the "resource in question" can take any of the followin
IAM member imports use space-delimited identifiers; the resource in question, the role, and the account, e.g.
```
$ terraform import google_spanner_instance_iam_member.instance "project-name/instance-name roles/viewer foo@example.com"
$ terraform import google_spanner_instance_iam_member.instance "project-name/instance-name roles/viewer user:foo@example.com"
```
IAM binding imports use space-delimited identifiers; the resource in question and the role, e.g.