# Groups

Groups are a collection of users, service accounts and roles.

## Assigning Users to Groups

Users can be assign to Groups in two ways:

1. Manual
2. Linked from the groups provided by your SSO provider

This behaviour can be toggled in the organizational settings of your profile. To control the default set the following in the **config.yaml** for HQ.

```yaml
users_group_membership_management_mode: [manual|sso]
```

Groups can be defined with the following metadata:

1. Colour
2. Description

Each group has a resource that unique identifies it across an HQ installation.

## Create a Group

To Create Group go to **IAM->Groups->New Group,** create the group, assign members, service accounts and roles.

<figure><img src="https://3471212993-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJpmk4J5g3Kj2RRRpYUrl%2Fuploads%2F3kudPmupBELrOHhGdlJ1%2Fiam-groups.PNG?alt=media&#x26;token=d66950fd-7055-4678-a7f5-3e38185946fd" alt=""><figcaption><p>IAM Groups</p></figcaption></figure>

You can also manage Users via the CLI and YAML, for integration in your CI/CD pipelines.

{% code title="terminal" %}

```bash
➜  lenses groups
Manage Groups.

Usage:
  lenses groups [command]

Aliases:
  groups, grp

Available Commands:
  create      Creates a new Group.
  delete      Deletes a group.
  get         Gets a group by its name.
  list        Lists all groups
  metadata    Manages group metadata.
  update      Updates a group.
```

{% endcode %}
