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

Add Data Source for Roles and Resource for RoleAssignment #53

Closed
megan07 opened this issue May 18, 2021 · 1 comment · Fixed by #66
Closed

Add Data Source for Roles and Resource for RoleAssignment #53

megan07 opened this issue May 18, 2021 · 1 comment · Fixed by #66
Labels
enhancement New feature or request
Milestone

Comments

@megan07
Copy link
Contributor

megan07 commented May 18, 2021

It'd be nice to create RoleAssignments so we can add admin roles to service accounts as explained here: hashicorp/terraform-provider-google#6704 (comment)

This would likely require a data source for roles as well.

Something like

data "googleworkspace_roles" "roles" {
  customer_id = "Cust0123id"
  filter {
    name = "items.role_name"
    value = "_GROUPS_ADMIN_ROLE"
  }
}

data "google_service_account" "my-sa" {
  account_id = "my-service-account"
}

resource "googleworkspace_role_assignment" "group_admin" {
  customer_id = "Cust0123id"
  assigned_to  = google_service_account.my-sa.unique_id
  role_id = gsuite_roles.0.role_id
  scope_type = "customer" 
}

Roles: https://developers.google.com/admin-sdk/directory/reference/rest/v1/roles
RoleAssignements: https://developers.google.com/admin-sdk/directory/reference/rest/v1/roleAssignments

@megan07 megan07 added the enhancement New feature or request label May 18, 2021
@megan07 megan07 added this to the 0.2.0 milestone May 21, 2021
@megan07
Copy link
Contributor Author

megan07 commented Jun 10, 2021

Closed by #53

@megan07 megan07 closed this as completed Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant