This folder contains an example how to implement the GSuite Authentication for Terraform.
Google SDK Documentation about Delegation
Go to IAM service accounts and create a Service account.
- enter Service account name
- add yourself to 'Grant users access to this service account'
In the Service account overview open the 'Actions' menu on the right of the dedicated service account and choose Manage keys. Click on 'Add key' and create a new key in JSON format, this key will be used for Terraform. Go back to Details and copy the Unique ID.
Go to Google Admin console Domain wide delegation.
Get the Service account with the ID provided before (Service account details), then add the following oauth scopes:
https://www.googleapis.com/auth/admin.directory.user, https://www.googleapis.com/auth/admin.directory.userschema, https://www.googleapis.com/auth/admin.directory.group, https://www.googleapis.com/auth/apps.groups.settings
Add credentials to terraform.tfvars, see terraform.tfvars.example. For Googleworkspace Customer ID, see Find your customer ID.