Skip to content

get_compliance_details_by_config_rule async

get_compliance_details_by_config_rule(
    config_rule_name: StringWithCharLimit64,
    *,
    config_overrides: Optional[AsyncConfigServiceClientConfig] = None,
    compliance_types: Optional[ComplianceTypes] = None,
    limit: Optional[Limit] = None,
    next_token: Optional[NextToken] = None,
) -> GetComplianceDetailsByConfigRuleResponse

Returns the evaluation results for the specified Config rule. The results indicate which Amazon Web Services resources were evaluated by the rule, when each resource was last evaluated, and whether each resource complies with the rule.

Parameters:

  • config_rule_name (StringWithCharLimit64) –

    The name of the Config rule for which you want compliance information.

  • compliance_types (Optional[ComplianceTypes], default: None ) –

    Filters the results by compliance.

    INSUFFICIENT_DATA is a valid ComplianceType that is returned when an Config rule cannot be evaluated. However, INSUFFICIENT_DATA cannot be used as a ComplianceType for filtering results.

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

    The maximum number of evaluation results returned on each page. The default is 10. You cannot specify a number greater than 100. If you specify 0, Config uses the default.

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

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

Raises:

  • InvalidNextTokenException –

    The specified next token is not valid. Specify the nextToken string that was returned in the previous response to get the next page of results.

  • InvalidParameterValueException –

    One or more of the specified parameters are not valid. Verify that your parameters are valid and try again.

  • NoSuchConfigRuleException –

    The Config rule in the request is not valid. Verify that the rule is an Config Process Check rule, that the rule name is correct, and that valid Amazon Resouce Names (ARNs) are used before trying again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_config_service/_services/async_config_service.py
async def get_compliance_details_by_config_rule(
    self,
    config_rule_name: "capo_config_service.types.string_with_char_limit64.StringWithCharLimit64",
    *,
    config_overrides: Optional[AsyncConfigServiceClientConfig] = None,
    compliance_types: Optional[
        "capo_config_service.types.compliance_types.ComplianceTypes"
    ] = None,
    limit: Optional["capo_config_service.types.limit.Limit"] = None,
    next_token: Optional["capo_config_service.types.next_token.NextToken"] = None,
) -> "capo_config_service.types.get_compliance_details_by_config_rule_response.GetComplianceDetailsByConfigRuleResponse":
    """<p>Returns the evaluation results for the specified Config rule. The results indicate which Amazon Web Services resources were evaluated by the rule, when each resource was last evaluated, and whether each resource complies with the rule.</p>

    Args:
        config_rule_name: <p>The name of the Config rule for which you want compliance information.</p>
        compliance_types: <p>Filters the results by compliance.</p> <p> <code>INSUFFICIENT_DATA</code> is a valid <code>ComplianceType</code> that is returned when an Config rule cannot be evaluated. However, <code>INSUFFICIENT_DATA</code> cannot be used as a <code>ComplianceType</code> for filtering results.</p>
        limit: <p>The maximum number of evaluation results returned on each page. The default is 10. You cannot specify a number greater than 100. If you specify 0, Config uses the default.</p>
        next_token: <p>The <code>nextToken</code> string returned on a previous page that you use to get the next page of results in a paginated response.</p>

    Raises:
        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.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more of the specified parameters are not valid. Verify that your parameters are valid and try again.</p>
        capo_config_service.errors.no_such_config_rule_exception.NoSuchConfigRuleException: <p>The Config rule in the request is not valid. Verify that the rule is an Config Process Check rule, that the rule name is correct, and that valid Amazon Resouce Names (ARNs) are used before trying again.</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.get_compliance_details_by_config_rule_request.GetComplianceDetailsByConfigRuleRequest]",
    ) -> AsyncOperationResponse[
        "capo_config_service.types.get_compliance_details_by_config_rule_response.GetComplianceDetailsByConfigRuleResponse"
    ]:
        import capo_config_service._operations.starling_dove_service.get_compliance_details_by_config_rule

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetComplianceDetailsByConfigRule")
    )
    input_: capo_config_service.types.get_compliance_details_by_config_rule_request.GetComplianceDetailsByConfigRuleRequest = {
        "config_rule_name": config_rule_name
    }
    if compliance_types is not None:
        input_["compliance_types"] = compliance_types
    if limit is not None:
        input_["limit"] = limit
    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