The group members resource manages the members of an HCP Group.
The user or service account that is running Terraform when creating an hcp_group_members
resource must have roles/admin
on the organization.
resource "hcp_group_members" "example" {
group = hcp_group.example.resource_name
members = [
hcp_user_principal.example1.id,
hcp_user_principal.example2.id,
]
}
group
(String) The group's resource name in the format iam/organization/<organization_id>/group/<name>
members
(List of String) A list of user principal IDs to add to the group.Import is supported using the following syntax:
# Group Members can be imported by specifying the group resource name
terraform import hcp_group_members.example "iam/organization/org_id/group/group-name"