terraform-google-modules / terraform-google-iam

Manages multiple IAM roles for resources on Google Cloud
https://registry.terraform.io/modules/terraform-google-modules/iam/google
Apache License 2.0
189 stars 171 forks source link

Empty Permissions [] #152

Closed SpyderDave closed 2 years ago

SpyderDave commented 2 years ago

If I do this

module "custom-roles" { source = "terraform-google-modules/iam/google//modules/custom_role_iam"

base_roles = ["roles/compute.viewer", "roles/bigquery.viewer"] permissions = [] }

I get an error that the permissions must contain a single value.

I am attempting to just create a role which contains all of the permissions in the base_roles

morgante commented 2 years ago

Can you please provide the full error message / logs?

SpyderDave commented 2 years ago

It's from a slightly different set of code but same error.

╷ │ Error: List shorter than MinItems │ │ with module.test-combined-roles["th-viewer-with-cloudbuildeditor"].google_organization_iam_custom_role.org-custom-role[0], │ on .terraform/modules/test-combined-roles/modules/custom_role_iam/main.tf line 51, in resource "google_organization_iam_custom_role" "org-custom-role": │ 51: permissions = local.permissions │ │ Attribute supports 1 item minimum, config has 0 declared ╵ ╷ │ Error: List shorter than MinItems │ │ with module.test-combined-roles["th-viewer-with-cloudbuildviewer"].google_organization_iam_custom_role.org-custom-role[0], │ on .terraform/modules/test-combined-roles/modules/custom_role_iam/main.tf line 51, in resource "google_organization_iam_custom_role" "org-custom-role": │ 51: permissions = local.permissions │ │ Attribute supports 1 item minimum, config has 0 declared ╵ ╷ │ Error: List shorter than MinItems │ │ with module.test-combined-roles["th-network-viewer"].google_organization_iam_custom_role.org-custom-role[0], │ on .terraform/modules/test-combined-roles/modules/custom_role_iam/main.tf line 51, in resource "google_organization_iam_custom_role" "org-custom-role": │ 51: permissions = local.permissions │ │ Attribute supports 1 item minimum, config has 0 declared

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days