Skip to content

select_aggregate_resource_config async

select_aggregate_resource_config(
    expression: Expression,
    configuration_aggregator_name: ConfigurationAggregatorName,
    *,
    config_overrides: Optional[AsyncConfigServiceClientConfig] = None,
    limit: Optional[Limit] = None,
    max_results: Optional[Limit] = None,
    next_token: Optional[NextToken] = None,
) -> SelectAggregateResourceConfigResponse

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 section in the Config Developer Guide.

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.

Parameters:

  • expression (Expression) –

    The SQL query SELECT command.

  • configuration_aggregator_name (ConfigurationAggregatorName) –

    The name of the configuration aggregator.

  • limit (Optional[Limit], default: None ) –

    The maximum number of query results returned on each page.

  • max_results (Optional[Limit], default: None ) –

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

  • next_token (Optional[NextToken], default: None ) –

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

Raises:

Source code in docs_src/capo_config_service/_services/async_config_service.py
async def select_aggregate_resource_config(
    self,
    expression: "capo_config_service.types.expression.Expression",
    configuration_aggregator_name: "capo_config_service.types.configuration_aggregator_name.ConfigurationAggregatorName",
    *,
    config_overrides: Optional[AsyncConfigServiceClientConfig] = None,
    limit: Optional["capo_config_service.types.limit.Limit"] = None,
    max_results: Optional["capo_config_service.types.limit.Limit"] = None,
    next_token: Optional["capo_config_service.types.next_token.NextToken"] = None,
) -> "capo_config_service.types.select_aggregate_resource_config_response.SelectAggregateResourceConfigResponse":
    """<p>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.</p> <p>For more information about query components, see the <a href="https://docs.aws.amazon.com/config/latest/developerguide/query-components.html"> <b>Query Components</b> </a> section in the <i>Config Developer Guide</i>.</p> <note> <p>If you run an aggregation query (i.e., using <code>GROUP BY</code> or using aggregate functions such as <code>COUNT</code>; e.g., <code>SELECT resourceId, COUNT(*) WHERE resourceType = 'AWS::IAM::Role' GROUP BY resourceId</code>) and do not specify the <code>MaxResults</code> or the <code>Limit</code> query parameters, the default page size is set to 500.</p> <p>If you run a non-aggregation query (i.e., not using <code>GROUP BY</code> or aggregate function; e.g., <code>SELECT * WHERE resourceType = 'AWS::IAM::Role'</code>) and do not specify the <code>MaxResults</code> or the <code>Limit</code> query parameters, the default page size is set to 25.</p> </note>

    Args:
        expression: <p>The SQL query SELECT command. </p>
        configuration_aggregator_name: <p>The name of the configuration aggregator.</p>
        limit: <p>The maximum number of query results returned on each page. </p>
        max_results: <p>The maximum number of query results returned on each page. Config also allows the Limit request parameter.</p>
        next_token: <p>The nextToken string returned in a previous request that you use to request the next page of results in a paginated response. </p>

    Raises:
        capo_config_service.errors.invalid_expression_exception.InvalidExpressionException: <p>The syntax of the query is incorrect.</p>
        capo_config_service.errors.invalid_limit_exception.InvalidLimitException: <p>The specified limit is outside the allowable range.</p>
        capo_config_service.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The specified next token is not valid. Specify the <code>nextToken</code> string that was returned in the previous response to get the next page of results.</p>
        capo_config_service.errors.no_such_configuration_aggregator_exception.NoSuchConfigurationAggregatorException: <p>You have specified a configuration aggregator that does not exist.</p>
        capo_config_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_config_service.types.select_aggregate_resource_config_request.SelectAggregateResourceConfigRequest]",
    ) -> AsyncOperationResponse[
        "capo_config_service.types.select_aggregate_resource_config_response.SelectAggregateResourceConfigResponse"
    ]:
        import capo_config_service._operations.starling_dove_service.select_aggregate_resource_config

        (
            output,
            http_response,
        ) = await capo_config_service._operations.starling_dove_service.select_aggregate_resource_config.async_select_aggregate_resource_config(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SelectAggregateResourceConfig")
    )
    input_: capo_config_service.types.select_aggregate_resource_config_request.SelectAggregateResourceConfigRequest = {
        "expression": expression,
        "configuration_aggregator_name": configuration_aggregator_name,
    }
    if limit is not None:
        input_["limit"] = limit
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output