# Groups

Sedai automatically infers cloud provider tags so you can meaningfully group resources. Groups can be used as custom filters in pages as well as a way to control [settings](https://docs.sedai.io/get-started/platform/settings/features/tag-configuration) for a subset of resources.

Groups should be created based on shared attributes — such as purpose, owner, or environment — so  your teams can focus on the resources they manage directly.

You can choose to configure groups to dynamically reflect infrastructure changes or represent a static collection of resources.

***

### Group Criteria

You can define a group's criteria based on any combination of the following attributes:

* Account&#x20;
* Cluster
* Region
* Namespace (for Kubernetes workloads)
* Resource type (such as AWS Lambda, AWS ECS, etc.)
* Tags

In addition to defining criteria, you can also add specific resources to a group (these will be added regardless of whether or not they match a group's criteria).

The criteria queries matching resources. Groups can be configured to either continuously query for matching resources, or to query once when the group is created for a static collection of matching resources.

#### Defining Tag Criteria

It's important to note that Sedai does not support adding tags to resources; it only infers pre-existing tags that have been added through your cloud provider. [Learn more](#configuring-tags) about configuring tags for your resources.

If you include tags in your group criteria, you will first select a key then see a list of its values.&#x20;

For each value you will see how many connected resources have the tag. You can select individual values or alternatively define wildcards using regular expressions.&#x20;

{% hint style="info" %}
When using regular expressions to select values, you must hit **enter** following the expression to apply it. The same input can be used to search values associated with a key. Please note that the expression is case-sensitive.
{% endhint %}

Groups use `and` logic between keys, and `or` logic between values. For example, this could be configured so that matching resources must have a combination of tags, but flexibility in the values for selected keys.

***

### How to Create a Group

You can create, edit, and delete groups from the **Settings > Groups** page.

1. Navigate to the Settings > Groups page. Select the **Create Group** button in the upper righthand corner of the screen.
2. Enter a nickname (this can be modified later).
3. Choose either **Continuous** or **One-time** resource discovery (:warning: **Note:**  This choice cannot be modified later).
   * **Continuous discovery**: Automatically updates resources within the group based on changes to tags and/or topology. This means associated resources may fluctuate as you update tags or deploy new resources.
   * **One-time discovery**: Only resources that match your criteria when the group is created will be added. Any future resources that meet the criteria will not be added to the group.&#x20;
4. After you click **Continue**, select a category from the side drawer to define your resource criteria. Click **Save** once you've finished making selections in a category.

Once you define your group's criteria, click the **Refresh** button underneath the group's name to view a count of resources that match the defined criteria. Click the **View Topology** button to explore matching resources' details; you can also search for a specific resource by name to validate whether it is part of the group.

***

### Group Settings

When you create a group, you can optionally define settings for its resources. If you do not define settings for a group, its resources will inherit settings from their respective account or Kubernetes cluster.

{% hint style="info" %}
You need to first create a group from the Settings > Groups page before defining settings for it.
{% endhint %}

#### How to Define Settings for a Group

1. Go to the **Settings > Resource** page. By default, you will see the Accounts tab; toggle to the **Groups** tab. This list displays all groups within Sedai as well as the current settings for resources within a group.
2. Select the group you want to modify.
3. Any resource that matches the group's criteria will appear in a list. To apply settings for all resources within the group, click the **Edit Settings** butto&#x6E;**.**
4. From the side drawer, select a feature to modify its setting. Selected settings will apply to all resources within the group.

You can choose to override settings for a specific resource to exclude it from group settings. Search for and select a resource to override the group's default.&#x20;

***

### Configuring Tags

Learn more about configuring tags within your cloud provider:

{% embed url="<https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html>" %}

{% embed url="<https://cloud.google.com/kubernetes-engine/docs/how-to/tags>" %}

{% embed url="<https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources?tabs=json>" %}

{% embed url="<https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/>" %}
