Group Members resource manages Google Workspace Groups Members. Group Members resides under the https://www.googleapis.com/auth/admin.directory.group
client scope.
resource "googleworkspace_group" "sales" {
email = "sales@example.com"
}
resource "googleworkspace_user" "michael" {
primary_email = "michael.scott@example.com"
password = "34819d7beeabb9260a5c854bc85b3e44"
hash_function = "MD5"
name {
family_name = "Scott"
given_name = "Michael"
}
}
resource "googleworkspace_user" "frank" {
primary_email = "frank.scott@example.com"
password = "2095312189753de6ad47dfe20cbe97ec"
hash_function = "MD5"
name {
family_name = "Scott"
given_name = "Frank"
}
}
resource "googleworkspace_group_members" "sales" {
group_id = googleworkspace_group.sales.id
members {
email = googleworkspace_user.michael.primary_email
role = "MANAGER"
}
members {
email = googleworkspace_user.frank.primary_email
role = "MEMBER"
}
}
group_id
(String) Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.members
(Block Set) The members of the group (see below for nested schema)etag
(String) ETag of the resource.id
(String) The ID of this resource.members
Required:
email
(String) The member's email address. A member can be a user or another group. This property isrequired when adding a member to a group. The email must be unique and cannot be an alias of another group. If the email address is changed, the API automatically reflects the email address changes.Optional:
delivery_settings
(String) Defaults to ALL_MAIL
. Defines mail delivery preferences of member. Acceptable values are:
ALL_MAIL
: All messages, delivered as soon as they arrive. DAILY
: No more than one message a day. DIGEST
: Up to 25 messages bundled into a single message. DISABLED
: Remove subscription. NONE
: No messages.role
(String) Defaults to MEMBER
. The member's role in a group. The API returns an error for cycles in group memberships. For example, if group1 is a member of group2, group2 cannot be a member of group1. Acceptable values are:
MANAGER
: This role is only available if the Google Groups for Business is enabled using the Admin Console. A MANAGER
role can do everything done by an OWNER
role except make a member an OWNER
or delete the group. A group can have multiple MANAGER
members. MEMBER
: This role can subscribe to a group, view discussion archives, and view the group's membership list. OWNER
: This role can send messages to the group, add or remove members, change member roles, change group's settings, and delete the group. An OWNER must be a member of the group. A group can have more than one OWNER.type
(String) Defaults to USER
. The type of group member. Acceptable values are:
CUSTOMER
: The member represents all users in a domain. An email address is not returned and the ID returned is the customer ID. GROUP
: The member is another group. USER
: The member is a user.Read-Only:
id
(String) The unique ID of the group member. A member id can be used as a member request URI's memberKey.status
(String) Status of member.Import is supported using the following syntax:
terraform import googleworkspace_group_members.sales groups/01abcde23fg4h5i