-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New: add groups-in-group membership functionality INPRO-365
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,18 @@ role: | |
name: 'Example Role' | ||
``` | ||
##### Groups in Group example structure | ||
Group member have to be defined within the group definition. | ||
```yaml | ||
role: | ||
email: '[email protected]' | ||
name: 'Example Role' | ||
groups: | ||
- alt_role | ||
``` | ||
In this example the group 'alt_role' will be a member of the group 'role'. | ||
#### **Users example structure** | ||
```yaml | ||
jane: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
terraform { | ||
required_providers { | ||
gsuite = { | ||
source = "DeviaVir/gsuite" | ||
version = "0.1.58" | ||
} | ||
} | ||
} | ||
|
||
variable "groups" { | ||
type = map(any) | ||
description = "contains objects representing all defined Google Groups" | ||
} | ||
|
||
variable "group" { | ||
type = any | ||
description = "contains an object representing a Google Group" | ||
} | ||
|
||
/** | ||
* Ressource documentation: https://registry.terraform.io/providers/DeviaVir/gsuite/latest/docs/resources/group | ||
*/ | ||
|
||
resource "gsuite_group_member" "member" { | ||
for_each = toset(var.group.groups) | ||
group = var.group.email | ||
email = var.groups[each.value].email | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters