:doc:`Inspector <../../inspector>` / Client / create_resource_group

*********************
create_resource_group
*********************



.. py:method:: Inspector.Client.create_resource_group(**kwargs)

  

  Creates a resource group using the specified set of tags (key and value pairs) that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. The created resource group is then used to create an Amazon Inspector assessment target. For more information, see  CreateAssessmentTarget.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateResourceGroup>`_  


  **Request Syntax**
  ::

    response = client.create_resource_group(
        resourceGroupTags=[
            {
                'key': 'string',
                'value': 'string'
            },
        ]
    )
    
  :type resourceGroupTags: list
  :param resourceGroupTags: **[REQUIRED]** 

    A collection of keys and an array of possible values, '[{"key":"key1","values":["Value1","Value2"]},{"key":"Key2","values":["Value3"]}]'.

     

    For example,'[{"key":"Name","values":["TestEC2Instance"]}]'.

    

  
    - *(dict) --* 

      This data type is used as one of the elements of the  ResourceGroup data type.

      

    
      - **key** *(string) --* **[REQUIRED]** 

        A tag key.

        

      
      - **value** *(string) --* 

        The value assigned to a tag key.

        

      
    

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

    
    ::

      {
          'resourceGroupArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **resourceGroupArn** *(string) --* 

        The ARN that specifies the resource group that is created.

        
  
  **Exceptions**
  
  *   :py:class:`Inspector.Client.exceptions.InternalException`

  
  *   :py:class:`Inspector.Client.exceptions.InvalidInputException`

  
  *   :py:class:`Inspector.Client.exceptions.LimitExceededException`

  
  *   :py:class:`Inspector.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Inspector.Client.exceptions.ServiceTemporarilyUnavailableException`

  

  **Examples**

  Creates a resource group using the specified set of tags (key and value pairs) that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. The created resource group is then used to create an Amazon Inspector assessment target. 
  ::

    response = client.create_resource_group(
        resourceGroupTags=[
            {
                'key': 'Name',
                'value': 'example',
            },
        ],
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'resourceGroupArn': 'arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv',
        'ResponseMetadata': {
            '...': '...',
        },
    }

  