Skip to content
This repository has been archived by the owner on Jun 27, 2021. It is now read-only.

Add Data Source for Roles and Resource for RoleAssignment #147

Open
megan07 opened this issue Jun 29, 2020 · 0 comments
Open

Add Data Source for Roles and Resource for RoleAssignment #147

megan07 opened this issue Jun 29, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@megan07
Copy link

megan07 commented Jun 29, 2020

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 "gsuite_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 "gsuite_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" 
}
@DeviaVir DeviaVir added the enhancement New feature or request label Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants