:doc:`ConfigService <../../config>` / Client / select_aggregate_resource_config

********************************
select_aggregate_resource_config
********************************



.. py:method:: ConfigService.Client.select_aggregate_resource_config(**kwargs)

  

  Accepts a structured query language (SQL) SELECT command and an aggregator to query configuration state of Amazon Web Services resources across multiple accounts and regions, performs the corresponding search, and returns resource configurations matching the properties.

   

  For more information about query components, see the `**Query Components** <https://docs.aws.amazon.com/config/latest/developerguide/query-components.html>`__ section in the *Config Developer Guide*.

   

  .. note::

    

    If you run an aggregation query (i.e., using ``GROUP BY`` or using aggregate functions such as ``COUNT``; e.g., ``SELECT resourceId, COUNT(*) WHERE resourceType = 'AWS::IAM::Role' GROUP BY resourceId``) and do not specify the ``MaxResults`` or the ``Limit`` query parameters, the default page size is set to 500.

     

    If you run a non-aggregation query (i.e., not using ``GROUP BY`` or aggregate function; e.g., ``SELECT * WHERE resourceType = 'AWS::IAM::Role'``) and do not specify the ``MaxResults`` or the ``Limit`` query parameters, the default page size is set to 25.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/SelectAggregateResourceConfig>`_  


  **Request Syntax**
  ::

    response = client.select_aggregate_resource_config(
        Expression='string',
        ConfigurationAggregatorName='string',
        Limit=123,
        MaxResults=123,
        NextToken='string'
    )
    
  :type Expression: string
  :param Expression: **[REQUIRED]** 

    The SQL query SELECT command.

    

  
  :type ConfigurationAggregatorName: string
  :param ConfigurationAggregatorName: **[REQUIRED]** 

    The name of the configuration aggregator.

    

  
  :type Limit: integer
  :param Limit: 

    The maximum number of query results returned on each page.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of query results returned on each page. Config also allows the Limit request parameter.

    

  
  :type NextToken: string
  :param NextToken: 

    The nextToken string returned in a previous request that you use to request the next page of results in a paginated response.

    

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

    
    ::

      {
          'Results': [
              'string',
          ],
          'QueryInfo': {
              'SelectFields': [
                  {
                      'Name': 'string'
                  },
              ]
          },
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Results** *(list) --* 

        Returns the results for the SQL query.

        
        

        - *(string) --* 
    
      

      - **QueryInfo** *(dict) --* 

        Details about the query.

        
        

        - **SelectFields** *(list) --* 

          Returns a ``FieldInfo`` object.

          
          

          - *(dict) --* 

            Details about the fields such as name of the field.

            
            

            - **Name** *(string) --* 

              Name of the field.

              
        
      
    
      

      - **NextToken** *(string) --* 

        The nextToken string returned in a previous request that you use to request the next page of results in a paginated response.

        
  
  **Exceptions**
  
  *   :py:class:`ConfigService.Client.exceptions.InvalidExpressionException`

  
  *   :py:class:`ConfigService.Client.exceptions.NoSuchConfigurationAggregatorException`

  
  *   :py:class:`ConfigService.Client.exceptions.InvalidLimitException`

  
  *   :py:class:`ConfigService.Client.exceptions.InvalidNextTokenException`

  