DeviaVir / terraform-provider-gsuite

A @HashiCorp Terraform provider for managing G Suite resources.
MIT License
271 stars 77 forks source link

Return Group Principal ID #155

Closed kylegoch closed 4 years ago

kylegoch commented 4 years ago

Would it be possible to have the data resource for gsuite_group return the Principal ID (I think this is what it's called) of the group?

Currently I seem to be only to get the value out of the URL from the Admin Console under Group Management (not at groups.google.com). The URL looks like this for a group https://admin.google.com/ac/groups/xxxxxxxxxxxxxx when you click on it. And I need that id at xxxxxxxxxx elsewhere in Terraform.

DeviaVir commented 4 years ago

I'm not sure that principal ID is available (here's the list of available attributes https://godoc.org/google.golang.org/api/admin/directory/v1#Group), if it is the ID we can try returning that as an attribute, but you should already be able to check data.gsuite_group.your-group.id for it

kylegoch commented 4 years ago

Yep, that was it! I didnt see id in the docs so i assumed it wasnt available. Doing data.gsuite_group.your-group.id got me the ID i needed. Quick PR to just explicitly call out the id in docs via #157

DeviaVir commented 4 years ago

Thanks for the PR! Your doc update will be deployed soon. Closing this one out.