Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
[![Banner][banner-image]](https://masterpoint.io/)

# terraform-googleworkspace-users-groups-automation
# terraform-users-groups-automation-googleworkspace

[![Release][release-badge]][latest-release]

💡 Learn more about Masterpoint [below](#who-we-are-𐦂𖨆𐀪𖠋).

## Purpose and Functionality

This is a [child-module](https://opentofu.org/docs/language/modules/#child-modules) for managing Google Workspace users, groups, and roles.
Use this [child module](https://opentofu.org/docs/language/modules/#child-modules) to manage Google Workspace users, groups, and roles.

If you want to use this module with an existing Google Workspace, see the [import-existing-org](examples/import-existing-org) example, which demonstrates how to import your existing Google users and groups.

## Usage

### Step-by-Step Instructions

There are 2 provider authentication routes available,
1 - authenticate a service account via API keys
2 - authenticate using API keys and impersonate a real User with Super Admin privileges.

We recommend impersonating a Super Admin, which allows you to grant Admin privileges to users (service Accounts cannot do this).
There are two provider authentication methods available:

Follow the provider [authentication setup instructions](https://github.com/hashicorp/terraform-provider-googleworkspace/blob/main/docs/index.md#google-workspace-provider).
1. Authenticate using a Google Cloud service account key file.
2. Authenticate using a Google Cloud service account key file and impersonate a real user with Super Admin privileges.

<!-- TODO(weston) - provide step by step instructions for setting this up -->
We recommend method (2), impersonating a Super Admin, as this allows you to grant Admin privileges to users (service accounts cannot do this). To set this up, follow the [Domain-Wide Delegation authentication instructions](https://github.com/hashicorp/terraform-provider-googleworkspace/blob/main/docs/index.md#using-domain-wide-delegation).

Once you've finished the setup process, your provider block should look like this,
Once you've completed the setup process, your provider block should look like this:

```hcl
provider "googleworkspace" {
# use 'my_customer', which is an alias that Google's API recognizes to reference your account's customerId.
# For example - Custom Schemas on the user object will fail if the customer_id is set to your actual customer_id.
# For more details see: https://developers.google.com/workspace/admin/directory/reference/rest/v1/schemas/get
# Use 'my_customer' as an alias for your account's customerId to ensure compatibility with Google's API
# For example, custom schemas on the user object will fail if the customer_id is set to your actual customer_id
# For more details: https://developers.google.com/workspace/admin/directory/reference/rest/v1/schemas/get
customer_id = "my_customer"

credentials = "/path/to/credentials/my-google-project-credentials-1234567890.json"
Expand All @@ -50,7 +49,7 @@ provider "googleworkspace" {

```hcl
module "googleworkspace_users_groups" {
source = "git::https://github.com/masterpointio/terraform-googleworkspace-users-groups-automation.git"
source = "git::https://github.com/masterpointio/terraform-users-groups-automation-googleworkspace.git"

users = {
"[email protected]" = {
Expand Down Expand Up @@ -198,8 +197,8 @@ Copyright © 2016-2025 [Masterpoint Consulting LLC](https://masterpoint.io/)
[newsletter-url]: https://newsletter.masterpoint.io/
[youtube-badge]: https://img.shields.io/badge/YouTube-Subscribe-D191BF?style=for-the-badge&logo=youtube&logoColor=white
[youtube-url]: https://www.youtube.com/channel/UCeeDaO2NREVlPy9Plqx-9JQ
[release-badge]: https://img.shields.io/github/v/release/masterpointio/terraform-googleworkspace-users-groups-automation?color=0E383A&label=Release&style=for-the-badge&logo=github&logoColor=white
[latest-release]: https://github.com/masterpointio/terraform-googleworkspace-users-groups-automation/releases/latest
[contributors-image]: https://contrib.rocks/image?repo=masterpointio/terraform-googleworkspace-users-groups-automation
[contributors-url]: https://github.com/masterpointio/terraform-googleworkspace-users-groups-automation/graphs/contributors
[issues-url]: https://github.com/masterpointio/terraform-googleworkspace-users-groups-automation/issues
[release-badge]: https://img.shields.io/github/v/release/masterpointio/terraform-users-groups-automation-googleworkspace?color=0E383A&label=Release&style=for-the-badge&logo=github&logoColor=white
[latest-release]: https://github.com/masterpointio/terraform-users-groups-automation-googleworkspace/releases/latest
[contributors-image]: https://contrib.rocks/image?repo=masterpointio/terraform-users-groups-automation-googleworkspace
[contributors-url]: https://github.com/masterpointio/terraform-users-groups-automation-googleworkspace/graphs/contributors
[issues-url]: https://github.com/masterpointio/terraform-users-groups-automation-googleworkspace/issues