

# Using tag-based resource groups in Network Firewall
<a name="resource-groups"></a>

Use *tag-based resource groups* to ensure that your rules stay in sync as your AWS resources change. A tag-based resource group is a collection of AWS resources, grouped by tags, that you can reference in an Network Firewall stateful rule group. A tag is a label that you assign to an AWS resource. As you add, delete, and modify your resources belonging to the resource group, Network Firewall automatically updates your rules with the IPs of the resources in the resource group. For information about referencing resource groups in rule groups, see [IP set references in Suricata compatible AWS Network Firewall rule groups](rule-groups-ip-set-references.md).

**Topics**
+ [Settings for the resource groups that you use in AWS Network Firewall](resource-group-settings.md)
+ [Creating a resource group in AWS Network Firewall](resource-group-creating.md)
+ [Updating a resource group in AWS Network Firewall](resource-group-updating.md)
+ [Deleting a resource group in AWS Network Firewall](resource-group-deleting.md)

# Settings for the resource groups that you use in AWS Network Firewall
<a name="resource-group-settings"></a>

The tag-based resource groups that you configure for Network Firewall help ensure that your rules stay in sync as your AWS resources change. You can reference a resource group in your Network Firewall stateful rule groups. 

The following settings apply to resource groups. 
+ **Name** – The identifier for the resource group. You assign a unique name to every resource group. You can't change the name of a resource group after you create it.
+ **Description** – Optional additional information about the resource group. Fill in any information that might help you remember the purpose of the resource group and how you want to use it. The description is included in resource group lists in the console and through the APIs.
+ **Grouping criteria** – Tag the resource types to add to the resource group. A tag consists of a key and a value, both of which you define. A resource type is a type of AWS resource, such as an Amazon EC2 instance. Network Firewall adds to the resource group all the resource types within your account matching the tags. As you create, update, or delete resource types that match the tags, Network Firewall automatically updates the resource group to include the resources. Network Firewall constantly checks your account for resources that match the grouping criteria.
+ **Preview resources** – A list of all of the resources within your account in the current Region that match the grouping criteria.
+ **Tags** – Optional key-value tag pairs. These tags apply to the resource group itself, not the individual resources within it. You can use tags to search and filter your resources and to track your AWS costs. For more information about tags, see [Tagging AWS Network Firewall resources](tagging.md).

# Creating a resource group in AWS Network Firewall
<a name="resource-group-creating"></a>

Use tag-based resource groups to identify collections of AWS resources. You can track the resource groups in your Network Firewall stateful rule groups, to ensure that your rules stay in sync as your resources change. 

You can create a resource group for use in AWS Network Firewall either in the Network Firewall console or with the AWS Resource Groups [CreateGroup](https://docs.aws.amazon.com/ARG/latest/APIReference/API_CreateGroup.html) API. Use the following procedure to create a resource group in the Network Firewall console. For information about creating a resource group in Resource Groups, see [AWS::NetworkFirewall::RuleGroup](https://docs.aws.amazon.com/ARG/latest/userguide/about-slg.html#about-slg-types-network-firewall-rulegroup) in the *Resource Groups User Guide*.

**To create a resource group in the console**

1. Sign in to the AWS Management Console and open the Amazon VPC console at [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/).

1. In the navigation pane, under **Network Firewall**, choose **Network Firewall resource groups**.

1. Choose **Create resource group**.

1. Enter a **Name** to identify the resource group. 
**Note**  
You can't change the name after you create the resource group.

1. (Optional) Enter a **Description** for the resource group.

1. For **Grouping criteria**, choose the resource types and tags to associate to this resource group. As you create, update, or delete resources in your account in the current Region that match the grouping criteria, Network Firewall automatically updates this resource group with those changes.
   + **Resource types** - Choose the resource types to include in the resource group. Network Firewall supports the following resource types:
     + Amazon EC2 instances
     + Amazon EC2 network interfaces
   + **Tags** - Add key value tags to the resource types. A tag consists of a key and a value, both of which you define. For example, if you have two Amazon EC2 instances, you might assign both a tag key of "Stack." But the value of "Stack" might be "Testing" for one and "Production" for the other. You can choose from the existing tags in your account, or add your own tags. For information about best practices for tagging resources, see [Best practices for tag names](https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html#id_tags_naming_best_practices) in the *AWS Tag Editor User Guide*.

1. Select the **Preview resources** button to preview the resources in your account in the current Region that match the grouping criteria. The resources that match the grouping criteria display in the **Preview resources** section. If there aren't resources that match the grouping criteria, no resources will display. However, if at any time you create resources that match the grouping criteria, Network Firewall will automatically display these resources in the **Preview resources** pane.

1. (Optional) In the **Add tags** section, enter a key and optional value for any tag that you want added to this resource group. Tags help you organize and manage your AWS resources. For more information about tagging your resources, see [Tagging AWS Network Firewall resources](tagging.md). 

1. Choose **Create resource group**.

Your new resource group is added to the list in the **Resource group** page.

To use a resource group, include the resource group's Amazon Resource Name (ARN) in a stateful rule's IP set reference. For information about using resource groups in IP set references, see [Referencing resource groups](rule-groups-ip-set-references.md#rule-groups-referencing-resource-groups).

# Updating a resource group in AWS Network Firewall
<a name="resource-group-updating"></a>

You can change your resource group settings in the Network Firewall console or the AWS Resource Groups [UpdateGroup](https://docs.aws.amazon.com/ARG/latest/APIReference/API_UpdateGroup.html) API. To change your resource group settings in the Network Firewall console, use the following procedure:

**To update a resource group**

1. Sign in to the AWS Management Console and open the Amazon VPC console at [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/).

1. In the navigation pane, under **Network Firewall**, choose **Network Firewall resource groups**.

1. In the **Resource group** page, select the name of the resource group you want to update. 

1. Make your changes. You can't change the name of a resource group after creation, but you can change other details and you can change the rule groups.

1. Choose **Save** to save your changes.

**How Network Firewall propagates your changes**  
When you make any changes to a firewall, including changes to any of the firewall's components, like rule groups, TLS inspection configurations, and firewall policies, Network Firewall propagates the changes everywhere that the firewall is used. Your changes are normally applied within minutes, but there might be a brief period of inconsistency when the changes have arrived in some places and not in others. For example, if you modify a rule group so that it drops an additional type of packet, for a firewall that uses the rule group, the new packet type might briefly be dropped by one firewall endpoint while still being allowed by another. 

This temporary inconsistency can occur when you first create a firewall and when you make changes to an existing firewall. Generally, any inconsistencies of this type last only a few seconds. 

When you add a TLS inspection configuration to an existing firewall, Network Firewall interrupts traffic flows that match the criteria defined by the TLS inspection configuration scope configuration. Network Firewall will begin SSL/TLS decryption and inspection for new connections to the firewall.

Changes to stateful rules are applied only to new traffic flows. Other firewall changes, including changes to stateless rules, are applied to all network packets. 

# Deleting a resource group in AWS Network Firewall
<a name="resource-group-deleting"></a>

You can delete your resource group in the Network Firewall console or the AWS Resource Groups [DeleteGroup](https://docs.aws.amazon.com/ARG/latest/APIReference/API_DeleteGroup.html) API. To delete a resource group in the Network Firewall console, perform the following procedure.

**Deleting a resource group**  
You can't delete a resource group that's referenced in a rule group. When you try to delete a resource group, AWS Network Firewall checks to see if it's currently being referenced. A resource group can be referenced by a rule group. If Network Firewall determines that the resource is being referenced, it warns you. Network Firewall is almost always able to determine whether a resource is being referenced. However, in rare cases, it might not be able to do so. If you need to be sure that the resource that you want to delete isn't in use, check all of your rule groups before deleting it. Note that policies that have associations can't be deleted.

**To delete a resource group**

1. Sign in to the AWS Management Console and open the Amazon VPC console at [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/).

1. In the navigation pane, under **Network Firewall**, choose **Network Firewall resource groups**.

1. In the **Resource group** page, select the resource group that you want to delete. 

1. Choose **Delete**, and confirm your request.

Your resource group is removed from the list in the **Resource group** page.