

# Grouping resources in an Application Component
<a name="AppComponent.grouping"></a>

When the application is imported into AWS Resilience Hub along with its resources, AWS Resilience Hub makes its best effort to group related resources into the same AppComponent when you import your application, but the grouping might not always be 100 percent accurate. Some resources are blocked for manual grouping and will be grouped automatically when applicable because these services have strict dependencies that require specific grouping configurations. For a complete list of services that are blocked for manual grouping, see [Blocked services for manual grouping](blocked-services-for-manual-grouping.md).

AWS Resilience Hub performs the following activities after your application and its resources are successfully imported: 
+ Scans your resources to check if they can be re-grouped into new AppComponents to improve the assessment accuracy. 
+ If AWS Resilience Hub identifies resources that can be re-grouped into new AppComponents, it displays the same as recommendations and allows you to either accept or reject the same. In AWS Resilience Hub, the confidence level assigned to a grouping recommendation indicates the degree of certainty with which the resources should be grouped together based on their attributes and metadata. A **High** confidence level indicates that AWS Resilience Hub has a confidence level of 90% or above that the resources in that group are related and should be grouped together. A **Medium** confidence level indicates that AWS Resilience Hub has a confidence level between 70% and 90% that the resources in that group are related and should be grouped together.

**Note**  
AWS Resilience Hub requires the correct grouping so that it can compute estimated workload RTO and estimated workload RPO to generate recommendations.

The following are examples of correct groupings:
+ Group primary databases and replicas under a single AppComponent.
+ Group Amazon EC2 instances that run the same application under a single AppComponent.
+ Group Amazon ECS services in one Region and failover Amazon ECS services in another Region under a single AppComponent.

For more information about reviewing and including resource grouping recommendations by AWS Resilience Hub, see the following topics:
+ [AWS Resilience Hub resource grouping recommendations](grouping-recommendation.md)
+ [Manually grouping resources into an AppComponent](AppComponent-manual-grouping.md)

# Blocked services for manual grouping
<a name="blocked-services-for-manual-grouping"></a>

AWS Resilience Hub blocks you from manually grouping resources of certain AWS services to prevent configuration errors that could affect the resilience assessment and recommendations for your application. These services are automatically grouped based on their dependencies and configurations. When you define an application inclusive of these resources on AWS Resilience Hub, it analyzes their relationships, dependencies, and resilience requirements to create optimal groupings that ensure accurate assessment results.

List of AWS services blocked for manual grouping:
+ Amazon API Gateway
+ Amazon DocumentDB
+ Amazon DynamoDB
+ Amazon Elastic Block Store
+ Amazon Elastic File System
+ Amazon Relational Database Service
+ Amazon S3
+ Amazon Simple Queue Service
+ FSx for Windows File Server
+ NAT Gateway

# AWS Resilience Hub resource grouping recommendations
<a name="grouping-recommendation"></a>

This section explains how to generate and review resource grouping recommendations in AWS Resilience Hub.

**Note**  
You can grant the necessary IAM permissions that are required to work with AWS Resilience Hub by using `AWSResilienceHubAsssessmentExecutionPolicy` AWS managed policy. For more information about AWS managed policy, see [AWSResilienceHubAsssessmentExecutionPolicy](security-iam-awsmanpol.md#security_iam_aws-assessment-policy).<a name="view-resource-grouping"></a>

**To view resource grouping recommendations**

1. In the navigation pane, choose **Applications**.

1. Choose **Add application** page, choose the application name for which you want to review resource grouping recommendations.

1. Choose the **Application structure** tab.

1. If AWS Resilience Hub displays an information alert, choose **Review recommendations** to view all the resource grouping recommendations. Else complete the following steps to manually generate resource grouping recommendations:

   1. Choose **Resources**.

   1. Choose **Get grouping recommendations** from **Actions** menu.

      AWS Resilience Hub scans your resources to check how they can be grouped in the best possible way into relevant AppComponents to improve the accuracy of the assessments. If AWS Resilience Hub learns that your resources can be grouped together, it displays an information alert for the same.

   1. If the information alert is displayed, choose **Review recommendations** to view all the resource grouping recommendations.

   You can identify the AppComponents in the **Review resource grouping recommendations** section using the following:
   + **AppComponent name** – Name of the AppComponent in which the resources will be grouped.
   + **Confidence level** – Indicates the confidence level of AWS Resilience Hub in the grouping recommendation.
   + **Resource count** – Indicates the number of resources that will be grouped in the AppComponent.
   + **AppComponent type** – Indicates the type of AppComponent.

**To view resources that will be grouped in AppComponents**

1. Complete the steps in **[To view resource grouping recommendations](#view-resource-grouping)** procedure and then return to this procedure.

1. In **Review resource grouping recommendations** section, select the check box (adjacent to the **AppComponent name**) to view all the resources that will be grouped together within the selected AppComponent. If you select multiple check boxes, AWS Resilience Hub displays a dynamically generated **recommendations selected** section that groups the selected AppComponents under their respective AppComponent type. Choose the number below each AppComponent type to view all the resources that will be grouped together within the selected AppComponent.

   You can identify the resources that will be grouped in the selected AppComponent in the **Resources** section using the following:
   + **Logical ID** – Indicates the logical ID of the resource. A logical ID is a name used to identify resources in your AWS CloudFormation stack, Terraform state file, myApplications application, or AWS Resource Groups.
   + **Physical ID** – The actual assigned identifier for the resource, such as an Amazon EC2 instance ID or an Amazon S3 bucket name.
   + **Type** – Indicates the type of resource.
   + **Region** – AWS Region in which the resource is located.

**To accept resource grouping recommendations**

1. Complete the steps in **[To view resource grouping recommendations](#view-resource-grouping)** procedure and then return to this procedure. 

1. In the **Review resource grouping recommendations** section, select all the check boxes adjacent to the **AppComponent name**. To find a specific AppComponent, enter the AppComponent name in the **Find AppComponents** box.
**Note**  
By default, AWS Resilience Hub displays all the resource grouping recommendations. To filter the table with previously rejected resource grouping recommendations, choose **Previously rejected** from the dropdown menu adjacent to the **Find AppComponents** box.

1. Choose **Accept**.

1. Choose **Accept** in the **Accept resource grouping recommendation** dialog.

   AWS Resilience Hub displays an information alert if the resource grouping is successful. If you have accepted only a subset of resource grouping recommendations, **Review resource grouping recommendations** section displays all the resource grouping recommendations that you have not accepted.

**To reject resource grouping recommendations**

1. Complete the steps in **[To view resource grouping recommendations](#view-resource-grouping)** procedure and then return to this procedure.

1. In **Review resource grouping recommendations** section, select all the check boxes adjacent to the **AppComponent name**. To find a specific AppComponent, enter the AppComponent name in the **Find AppComponents** box.
**Note**  
By default, AWS Resilience Hub displays all the resource grouping recommendations. To filter the table with previously rejected resource grouping recommendations, select **Previously rejected** from the dropdown menu adjacent to the **Find AppComponents** box.

1. Choose **Reject**.

1. Select one of the reasons for rejecting the resource grouping recommendation and then choose **Reject** in the **Reject resource grouping recommendation** dialog.

   AWS Resilience Hub displays an information alert confirming the same. If you have rejected only a subset of resource grouping recommendations, **Review resource grouping recommendations** section displays all the resource grouping recommendations that you have not accepted.

# Manually grouping resources into an AppComponent
<a name="AppComponent-manual-grouping"></a>

This section explains how to manually group resources into an AppComponent and assigning different AppComponent to a resource in AWS Resilience Hub.

**To group resources**

1. In the navigation pane, choose **Applications**.

1. On the **Applications** page, choose the application name that contains the resources that you want to group.

1. Choose the **Application structure** tab.

1. Under **Version** tab, select the application version with **Draft** status.

1. Choose the **Resources** tab.

1. Select the check boxes that is adjacent to **Logical ID** to select all the resources you want to group.
**Note**  
You cannot choose manually added resources.

1. Choose **Actions**, and then choose **Group resources**. 

1. Choose an AppComponent from the **Choose AppComponent** dropdown list in which you want to group the resource.

1. Choose **Save**.

1. Choose **Publish new version**.

1. Choose the **Application structure** tab.

1. To view the published version of your application, complete the following steps: 

   1. Under **Version** tab, select the application version with **Current release** status.

   1. Choose the **Resources** tab.

**To assign resources to an AppComponent**

1. In the navigation pane, choose **Applications**.

1. On the **Applications** page, choose the application name that contains the resource you want to regroup.

1. Choose the **Application structure** tab.

1. Under **Version**, select the application version with **Draft** status.

1. Choose the **Resources** tab.

1. Select the check box that is adjacent to **Logical ID** to select the resource.

1. Choose **Change AppComponent** from **Actions** menu. 

1. To delete the current AppComponent from the **AppComponent** section, choose **X** in the upper-right corner of the label that displays your current AppComponent name.

1. To group the resource in a different AppComponent, choose a different AppComponent from the **Choose AppComponent** dropdown list.

1. Choose **Add**.

1. Delete any empty AppComponents from the **AppComponents** tab.

1. Choose **Publish new version**.

1. Choose the **Application structure** tab.

1. To view the published version of your application, complete the following steps: 

   1. Under **Version** tab, select the application version with **Current release** status.

   1. Choose the **Resources** tab.