A Terraform module to create and manage a Google Cloud Identity Group.
This module supports Terraform version 1 and is compatible with the Terraform Google Provider version 4. and 5._**
This module is part of our Infrastructure as Code (IaC) framework that enables our users and customers to easily deploy and manage reusable, secure, and production-grade cloud infrastructure.
- Module Features
- Getting Started
- Module Argument Reference
- Module Outputs
- External Documentation
- Module Versioning
- About Mineiros
- Reporting Issues
- Contributing
- Makefile Targets
- License
This module implements the following Terraform resources
google_cloud_identity_group
google_cloud_identity_group_membership
Most common usage of the module:
module "terraform-google-identity-group" {
source = "[email protected]:mineiros-io/terraform-google-identity-group.git?ref=v0.1.0"
group_key_id = "id-of-entity"
parent = "resource-name-of-entity"
memberships = [
{
id = "[email protected]"
roles = ["MEMBER"]
},
{
id = "[email protected]"
roles = ["MEMBER", "MANAGER"]
},
{
id = "[email protected]"
roles = ["MEMBER", "OWNER"]
}
]
}
NOTE: Google Groups are an organization level resource and can only be created and managed with Service Accounts or with a Principal that impersonates a single service account. The Service Account will require to be a Google Groups Admin to be able to create the Google Groups and manage the addition, removal of users/service accounts to and from the group. There are two different ways of enabaling a service account to work with the Google Groups API:
- Authenticating as a service account without domain-wide delegation (recommended)
- Authenticating as a service account with domain-wide delegation Granting a service account access to your organisation's data via domain-wide delegation should be used with caution. It can be reversed by disabling or deleting the service account or by removing access through the Google Workspace admin console.
See variables.tf and examples/ for details and use-cases.
-
group_key_id
: (Requiredstring
)The ID of the entity. For Google-managed entities, the id must be the email address of an existing group or user. For external-identity-mapped entities, the id must be a string conforming to the Identity Source's requirements. Must be unique within a namespace.
-
parent
: (Requiredstring
)The resource name of the entity under which this Group resides in the Cloud Identity resource hierarchy. Must be of the form
identitysources/{identity_source_id}
for external-identity-mapped groups orcustomers/{customer_id}
for Google Groups. -
labels
: (Optionalmap(string)
)The labels that apply to the Group.Must not contain more than one entry.Must contain the entry
cloudidentity.googleapis.com/groups.discussion_forum
: '' if the Group is a Google Group orsystem/groups/external
: '' if the Group is an external-identity-mapped group.Default is
{"cloudidentity.googleapis.com/groups.discussion_forum":""}
. -
display_name
: (Optionalstring
)The display name of the Group.
-
description
: (Optionalstring
)An extended description to help users determine the purpose of a Group. Must not be longer than 4,096 characters.
-
initial_group_config
: (Optionalstring
)The initial configuration options for creating a Group. Default value is
EMPTY
. Possible values areINITIAL_GROUP_CONFIG_UNSPECIFIED
,WITH_INITIAL_OWNER
, andEMPTY
.Default is
"EMPTY"
. -
group_key_namespace
: (Optionalstring
)The namespace in which the entity exists. If not specified, the EntityKey represents a Google-managed entity such as a Google user or a Google Group. If specified, the EntityKey represents an external-identity-mapped group. The namespace must correspond to an identity source created in Admin Console and must be in the form of
identitysources/{identity_source_id}
. -
memberships
: (Optionallist(membership)
)A list of memberships (id, roles) to get attached to the group resource created.
Default is
[]
.Example:
memberships = [ { id = "[email protected]" roles = ["MEMBER", "MANAGER"] } ]
Each
membership
object in the list accepts the following attributes:-
id
: (Requiredstring
)The id of the entity. For Google-managed entities, the id must be the email address of an existing group or user. For external-identity-mapped entities, the id must be a string conforming to the identity source's requirements.
-
roles
: (Optionallist(string)
)A list of roles to bind to this Membership. Possible values are
OWNER
,MANAGER
, andMEMBER
. Note: TheOWNER
andMANAGER
roles are supplementary roles that require theMEMBER
role to be assigned.Default is
["MEMBER"]
.
-
-
module_enabled
: (Optionalbool
)Specifies whether resources in the module will be created.
Default is
true
. -
module_timeouts
: (Optionalmap(timeout)
)A map of timeout objects that is keyed by Terraform resource name defining timeouts for
create
,update
anddelete
Terraform operations. Supported resources are:google_cloud_identity_group
google_cloud_identity_group_membership
Example:
module_timeouts = { google_cloud_identity_group = { create = "4m" update = "4m" delete = "4m" } google_cloud_identity_group_membership = { create = "4m" update = "4m" delete = "4m" } }
Each
timeout
object in the map accepts the following attributes: -
module_depends_on
: (Optionallist(dependency)
)A list of dependencies. Any object can be assigned to this list to define a hidden external dependency.
Default is
[]
.Example:
module_depends_on = [ null_resource.name ]
The following attributes are exported in the outputs of the module:
-
group
: (object(group)
)All attributes of the created
google_cloud_identity_group
resource. -
membership
: (object(membership)
)All attributes of the created
google_cloud_identity_group_membership
resource. -
module_enabled
: (bool
)Whether this module is enabled.
- Identity Overview - https://cloud.google.com/identity/
- Groups API Overview - https://cloud.google.com/identity/docs/groups
- Identity Group - https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_identity_group
- Identity Group Membership - https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_identity_group_membership
This Module follows the principles of Semantic Versioning (SemVer).
Given a version number MAJOR.MINOR.PATCH
, we increment the:
MAJOR
version when we make incompatible changes,MINOR
version when we add functionality in a backwards compatible manner, andPATCH
version when we make backwards compatible bug fixes.
- Backwards compatibility in versions
0.0.z
is not guaranteed whenz
is increased. (Initial development) - Backwards compatibility in versions
0.y.z
is not guaranteed wheny
is increased. (Pre-release)
Mineiros is a remote-first company headquartered in Berlin, Germany that solves development, automation and security challenges in cloud infrastructure.
Our vision is to massively reduce time and overhead for teams to manage and deploy production-grade and secure cloud infrastructure.
We offer commercial support for all of our modules and encourage you to reach out if you have any questions or need help. Feel free to email us at [email protected] or join our Community Slack channel.
We use GitHub Issues to track community reported issues and missing features.
Contributions are always encouraged and welcome! For the process of accepting changes, we use Pull Requests. If you'd like more information, please see our Contribution Guidelines.
This repository comes with a handy Makefile.
Run make help
to see details on each available target.
This module is licensed under the Apache License Version 2.0, January 2004. Please see LICENSE for full details.
Copyright © 2020-2022 Mineiros GmbH