:doc:`ResourceGroups <../../resource-groups>` / Client / group_resources

***************
group_resources
***************



.. py:method:: ResourceGroups.Client.group_resources(**kwargs)

  

  Adds the specified resources to the specified group.

   

  .. warning::

     

    You can only use this operation with the following groups:

     

    
    * ``AWS::EC2::HostManagement``
     
    * ``AWS::EC2::CapacityReservationPool``
     
    * ``AWS::ResourceGroups::ApplicationGroup``
    

     

    Other resource group types and resource types are not currently supported by this operation.

     

   

  **Minimum permissions**

   

  To run this command, you must have the following permissions:

   

  
  * ``resource-groups:GroupResources``
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GroupResources>`_  


  **Request Syntax**
  ::

    response = client.group_resources(
        Group='string',
        ResourceArns=[
            'string',
        ]
    )
    
  :type Group: string
  :param Group: **[REQUIRED]** 

    The name or the Amazon resource name (ARN) of the resource group to add resources to.

    

  
  :type ResourceArns: list
  :param ResourceArns: **[REQUIRED]** 

    The list of Amazon resource names (ARNs) of the resources to be added to the group.

    

  
    - *(string) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'Succeeded': [
              'string',
          ],
          'Failed': [
              {
                  'ResourceArn': 'string',
                  'ErrorMessage': 'string',
                  'ErrorCode': 'string'
              },
          ],
          'Pending': [
              {
                  'ResourceArn': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Succeeded** *(list) --* 

        A list of Amazon resource names (ARNs) of the resources that this operation successfully added to the group.

        
        

        - *(string) --* 
    
      

      - **Failed** *(list) --* 

        A list of Amazon resource names (ARNs) of any resources that this operation failed to add to the group.

        
        

        - *(dict) --* 

          A resource that failed to be added to or removed from a group.

          
          

          - **ResourceArn** *(string) --* 

            The Amazon resource name (ARN) of the resource that failed to be added or removed.

            
          

          - **ErrorMessage** *(string) --* 

            The error message text associated with the failure.

            
          

          - **ErrorCode** *(string) --* 

            The error code associated with the failure.

            
      
    
      

      - **Pending** *(list) --* 

        A list of Amazon resource names (ARNs) of any resources that this operation is still in the process adding to the group. These pending additions continue asynchronously. You can check the status of pending additions by using the ``ListGroupResources`` operation, and checking the ``Resources`` array in the response and the ``Status`` field of each object in that array.

        
        

        - *(dict) --* 

          A structure that identifies a resource that is currently pending addition to the group as a member. Adding a resource to a resource group happens asynchronously as a background task and this one isn't completed yet.

          
          

          - **ResourceArn** *(string) --* 

            The Amazon resource name (ARN) of the resource that's in a pending state.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`ResourceGroups.Client.exceptions.BadRequestException`

  
  *   :py:class:`ResourceGroups.Client.exceptions.ForbiddenException`

  
  *   :py:class:`ResourceGroups.Client.exceptions.NotFoundException`

  
  *   :py:class:`ResourceGroups.Client.exceptions.MethodNotAllowedException`

  
  *   :py:class:`ResourceGroups.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`ResourceGroups.Client.exceptions.InternalServerErrorException`

  