Skip to content

Commit

Permalink
Add warnings about custom role format for IAM bindings (#1600)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>

Co-authored-by: emily <[email protected]>
  • Loading branch information
modular-magician and emilymye committed Jan 8, 2020
1 parent 0d77be0 commit a13c794
Show file tree
Hide file tree
Showing 30 changed files with 90 additions and 0 deletions.
1 change: 1 addition & 0 deletions google-beta/resource_iam_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func resourceIamBindingRead(newUpdaterFunc newResourceIamUpdaterFunc) schema.Rea
}

if binding == nil {
log.Printf("[WARNING] Binding for role %q not found, assuming it has no members. If you expected existing members bound for this role, make sure your role is correctly formatted.", eBinding.Role)
log.Printf("[DEBUG] Binding for role %q and condition %+v not found in policy for %s, assuming it has no members.", eBinding.Role, eCondition, updater.DescribeResource())
d.Set("role", eBinding.Role)
d.Set("members", nil)
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/bigtable_instance_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ $ terraform import google_bigtable_instance_iam_binding.editor "projects/{projec
$ terraform import google_bigtable_instance_iam_member.editor "projects/{project}/instances/{instance} roles/editor user:[email protected]"
```

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ $ terraform import google_binary_authorization_attestor_iam_policy.editor projec
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/cloud_run_service_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ $ terraform import google_cloud_run_service_iam_policy.editor projects/{{project
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ $ terraform import google_cloudfunctions_function_iam_policy.editor projects/{{p
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/compute_instance_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ $ terraform import google_compute_instance_iam_policy.editor projects/{{project}
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/compute_subnetwork_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ $ terraform import google_compute_subnetwork_iam_policy.editor projects/{{projec
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/dataproc_cluster_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ $ terraform import google_dataproc_cluster_iam_binding.editor "projects/{project
$ terraform import google_dataproc_cluster_iam_member.editor "projects/{project}/regions/{region}/clusters/{cluster} roles/editor user:[email protected]"
```

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
3 changes: 3 additions & 0 deletions website/docs/r/dataproc_job_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ $ terraform import google_dataproc_job_iam_binding.editor "projects/{project}/re
$ terraform import google_dataproc_job_iam_member.editor "projects/{project}/regions/{region}/jobs/{job_id} roles/editor user:[email protected]"
```

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ IAM member imports use space-delimited identifiers; the resource in question, th
```
$ terraform import google_billing_account_iam_member.binding "your-billing-account-id roles/viewer user:[email protected]"
```

-> **Custom Roles**: If you're importing a IAM member with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
3 changes: 3 additions & 0 deletions website/docs/r/google_folder_iam_binding.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ IAM binding imports use space-delimited identifiers; first the resource in quest
```
$ terraform import google_folder_iam_binding.viewer "folder-name roles/viewer"
```

-> **Custom Roles**: If you're importing a IAM binding with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
3 changes: 3 additions & 0 deletions website/docs/r/google_folder_iam_member.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ IAM member imports use space-delimited identifiers; the resource in question, th
```
$ terraform import google_folder_iam_member.my_project "folder-name roles/viewer user:[email protected]"
```

-> **Custom Roles**: If you're importing a IAM member with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
3 changes: 3 additions & 0 deletions website/docs/r/google_organization_iam_binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ IAM binding imports use space-delimited identifiers; first the resource in quest
```
$ terraform import google_organization_iam_binding.my_org "your-org-id roles/viewer"
```

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
3 changes: 3 additions & 0 deletions website/docs/r/google_organization_iam_member.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ IAM member imports use space-delimited identifiers; the resource in question, th
```
$ terraform import google_organization_iam_member.my_org "your-org-id roles/viewer user:[email protected]"
```

-> **Custom Roles**: If you're importing a IAM member with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
4 changes: 4 additions & 0 deletions website/docs/r/google_project_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,7 @@ IAM audit config imports use the identifier of the resource in question and the
```
terraform import google_project_iam_audit_config.my_project "your-project-id foo.googleapis.com"
```

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

3 changes: 3 additions & 0 deletions website/docs/r/google_service_account_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ $ terraform import google_service_account_iam_binding.admin-account-iam "project
$ terraform import google_service_account_iam_member.admin-account-iam "projects/{your-project-id}/serviceAccounts/{your-service-account-email} roles/editor user:[email protected]"
```

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

With conditions:
```
$ terraform import -provider=google-beta google_service_account_iam_binding.admin-account-iam "projects/{your-project-id}/serviceAccounts/{your-service-account-email} iam.serviceAccountUser expires_after_2019_12_31"
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/healthcare_dataset_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,6 @@ IAM policy imports use the identifier of the resource in question. This policy
```
$ terraform import google_healthcare_dataset_iam_policy.dataset_iam your-project-id/location-name/dataset-name
```

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
3 changes: 3 additions & 0 deletions website/docs/r/iap_app_engine_service_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ $ terraform import google_iap_app_engine_service_iam_policy.editor projects/{{pr
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/iap_app_engine_version_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ $ terraform import google_iap_app_engine_version_iam_policy.editor projects/{{pr
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/iap_web_backend_service_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ $ terraform import google_iap_web_backend_service_iam_policy.editor projects/{{p
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/iap_web_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ $ terraform import google_iap_web_iam_policy.editor projects/{{project}}/iap_web
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/iap_web_type_app_engine_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ $ terraform import google_iap_web_type_app_engine_iam_policy.editor projects/{{p
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/iap_web_type_compute_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ $ terraform import google_iap_web_type_compute_iam_policy.editor projects/{{proj
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/pubsub_subscription_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@ $ terraform import google_pubsub_subscription_iam_binding.editor "projects/{your
$ terraform import google_pubsub_subscription_iam_member.editor "projects/{your-project-id}/subscriptions/{your-subscription-name} roles/editor [email protected]"
```

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
3 changes: 3 additions & 0 deletions website/docs/r/pubsub_topic_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ $ terraform import google_pubsub_topic_iam_policy.editor projects/{{project}}/to
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/runtimeconfig_config_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ $ terraform import google_runtimeconfig_config_iam_policy.editor projects/{{proj
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
3 changes: 3 additions & 0 deletions website/docs/r/sourcerepo_repository_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ $ terraform import google_sourcerepo_repository_iam_policy.editor projects/{{pro
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
4 changes: 4 additions & 0 deletions website/docs/r/spanner_database_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,7 @@ IAM policy imports use the identifier of the resource in question, e.g.
```
$ terraform import google_spanner_database_iam_policy.database project-name/instance-name/database-name
```

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

3 changes: 3 additions & 0 deletions website/docs/r/spanner_instance_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,6 @@ IAM policy imports use the identifier of the resource in question, e.g.
```
$ terraform import google_spanner_instance_iam_policy.instance project-name/instance-name
```

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
3 changes: 3 additions & 0 deletions website/docs/r/storage_bucket_iam.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ $ terraform import google_storage_bucket_iam_policy.editor b/{{bucket}}
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.

-> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).

0 comments on commit a13c794

Please sign in to comment.