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
197 stars 171 forks source link

Bugfix/support empty subnets #97

Closed ChandranshuRao14 closed 4 years ago

ChandranshuRao14 commented 4 years ago

Fixes #93

This PR supports empty lists for all submodules.

This PR uses an approach that creates a breaking change in projects_iam submodule by deprecating var.project. From my understanding, the projects and project variables in the projects_iam submodule are redundant. Passing in a single project_id in var.projects will handle both static and dynamic use cases. This would also fit the input pattern all the other submodules use (e.g var.storage_buckets, var.subnets). However, if there's a use case for keeping var.project, please let me know and I can take a different approach.

Changes:

Also Fixes #96 by updating documentation

morgante commented 4 years ago

We need to preserve var.project or at least otherwise verify that in the case of a dynamically generated project ID the module still works. Can you test/confirm that?

ChandranshuRao14 commented 4 years ago

Yes I modified a test that dynamically gets a generated project ID and passes it into var.projects which passes. Another existing test that uses dynamically generated project IDs in authoritative mode also passes. Would these tests suffice?