Skip to content

Commit

Permalink
Fix documentation around iam member imports
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
emilymye authored and modular-magician committed Jan 11, 2019
1 parent 5dc7dad commit 17ee141
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion google-beta/resource_iam_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/compute_subnetwork_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/google_billing_account_iam_member.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
4 changes: 2 additions & 2 deletions website/docs/r/google_folder_iam_member.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
4 changes: 2 additions & 2 deletions website/docs/r/google_kms_crypto_key_iam_member.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
4 changes: 2 additions & 2 deletions website/docs/r/google_kms_key_ring_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/google_organization_iam_member.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
16 changes: 12 additions & 4 deletions website/docs/r/google_project_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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_policy.my_project your-project-id
$ 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"
```

$ 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_member.my_project "your-project-id roles/viewer foo@example.com"
```
$ terraform import google_project_iam_policy.my_project your-project-id
```
4 changes: 2 additions & 2 deletions website/docs/r/google_service_account_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
4 changes: 2 additions & 2 deletions website/docs/r/spanner_database_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/spanner_instance_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 17ee141

Please sign in to comment.