Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can a iam member be given multiple roles one time? #3478

Closed
zffocussss opened this issue Apr 23, 2019 · 5 comments
Closed

can a iam member be given multiple roles one time? #3478

zffocussss opened this issue Apr 23, 2019 · 5 comments

Comments

@zffocussss
Copy link

I am using "google_project_iam_member"

resource "google_project_iam_member" "project" {
project = "your-project-id"
role = "roles/editor"
member = "user:[email protected]"
}
if I have multiple members,roles.How can I define them.
resource "google_project_iam_member" "project" {
project = "your-project-id"
role = "roles/1","roles/2","roles/3"
member = "user:a","user:b","user:c"
}

@rileykarson
Copy link
Collaborator

Hey @zffocussss!

google_project_iam_member is used to define a single user:role pairing. You can define multiple google_project_iam_member blocks to attach multiple roles to a single user, or multiple users to a single role.

Alternatively, if you have a single role with multiple members, you could use google_project_iam_binding with the caveat that Terraform will remove the role from any users not present in that config.

As well, a great place for these kinds of questions is the #terraform channel in the GCP Community Slack.

@zffocussss
Copy link
Author

It is not convenient to manage multiple roles and members.by the way.What is "project id"?

@rileykarson
Copy link
Collaborator

A project id is a unique id for a project; sometimes it's the same as the display name, but at other times it's different (generally with numbers appended). See the docs on identifying projects.

@zffocussss
Copy link
Author

thanks

@ghost
Copy link

ghost commented May 24, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants