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 170 forks source link

Conditional binding for Service Account roles #193

Closed minzetaos closed 10 months ago

minzetaos commented 1 year ago

TL;DR

The submodule member-iam service_accounts_iam doesn't support conditional binding, which is inconvenient for managing service account's permission through Terraform. Do you guys consider updating the module?

Terraform Resources

Add condition block to main.tf for resource "google_project_iam_member"

Detailed design

No response

Additional information

No response

imrannayer commented 1 year ago

Can you plz elaborate which sub-module is missing conditional support?

minzetaos commented 1 year ago

It's the service_accounts_iam module. It has conditional block for its principles, but look like it doesn't have conditional block for its own permission, which should involve this resource google_project_iam_member or google_organization_iam_member

imrannayer commented 1 year ago

@minzetaos purpose of service account IAM module is to grant permission on the service account. It is granting permission to service account on project or organization.

minzetaos commented 1 year ago

@imrannayer But wouldn't it be better and more common sense that service account module also includes granting service account permission to resources? Otherwise, users have to use two modules to control one service account.

imrannayer commented 1 year ago

@minzetaos These are two separate use cases and thats why handled by separate module. You can write a wrapper module which calls both modules to combine the functionality if you have a repetitive use case.

github-actions[bot] commented 10 months 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