Skip to content

get_compliance_details_by_resource

get_compliance_details_by_resource(
    *,
    config_overrides: Optional[ConfigServiceClientConfig] = None,
    resource_type: Optional[StringWithCharLimit256] = None,
    resource_id: Optional[BaseResourceId] = None,
    compliance_types: Optional[ComplianceTypes] = None,
    next_token: Optional[String] = None,
    resource_evaluation_id: Optional[ResourceEvaluationId] = None,
) -> GetComplianceDetailsByResourceResponse

Returns the evaluation results for the specified Amazon Web Services resource. The results indicate which Config rules were used to evaluate the resource, when each rule was last invoked, and whether the resource complies with each rule.

Parameters:

  • resource_type (Optional[StringWithCharLimit256], default: None ) –

    The type of the Amazon Web Services resource for which you want compliance information.

  • resource_id (Optional[BaseResourceId], default: None ) –

    The ID of the Amazon Web Services resource 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.

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

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

  • resource_evaluation_id (Optional[ResourceEvaluationId], default: None ) –

    The unique ID of Amazon Web Services resource execution for which you want to retrieve evaluation results.

    You need to only provide either a ResourceEvaluationID or a ResourceID and ResourceType.

Raises:

Source code in docs_src/capo_config_service/_services/config_service.py
def get_compliance_details_by_resource(
    self,
    *,
    config_overrides: Optional[ConfigServiceClientConfig] = None,
    resource_type: Optional[
        "capo_config_service.types.string_with_char_limit256.StringWithCharLimit256"
    ] = None,
    resource_id: Optional[
        "capo_config_service.types.base_resource_id.BaseResourceId"
    ] = None,
    compliance_types: Optional[
        "capo_config_service.types.compliance_types.ComplianceTypes"
    ] = None,
    next_token: Optional["capo_config_service.types.string.String"] = None,
    resource_evaluation_id: Optional[
        "capo_config_service.types.resource_evaluation_id.ResourceEvaluationId"
    ] = None,
) -> "capo_config_service.types.get_compliance_details_by_resource_response.GetComplianceDetailsByResourceResponse":
    """<p>Returns the evaluation results for the specified Amazon Web Services resource. The results indicate which Config rules were used to evaluate the resource, when each rule was last invoked, and whether the resource complies with each rule.</p>

    Args:
        resource_type: <p>The type of the Amazon Web Services resource for which you want compliance information.</p>
        resource_id: <p>The ID of the Amazon Web Services resource 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>
        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>
        resource_evaluation_id: <p>The unique ID of Amazon Web Services resource execution for which you want to retrieve evaluation results. </p> <note> <p>You need to only provide either a <code>ResourceEvaluationID</code> or a <code>ResourceID </code>and <code>ResourceType</code>.</p> </note>

    Raises:
        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.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_config_service.types.get_compliance_details_by_resource_request.GetComplianceDetailsByResourceRequest]",
    ) -> OperationResponse[
        "capo_config_service.types.get_compliance_details_by_resource_response.GetComplianceDetailsByResourceResponse"
    ]:
        import capo_config_service._operations.starling_dove_service.get_compliance_details_by_resource

        output, http_response = (
            capo_config_service._operations.starling_dove_service.get_compliance_details_by_resource.get_compliance_details_by_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetComplianceDetailsByResource")
    )
    input_: capo_config_service.types.get_compliance_details_by_resource_request.GetComplianceDetailsByResourceRequest = {}
    if resource_type is not None:
        input_["resource_type"] = resource_type
    if resource_id is not None:
        input_["resource_id"] = resource_id
    if compliance_types is not None:
        input_["compliance_types"] = compliance_types
    if next_token is not None:
        input_["next_token"] = next_token
    if resource_evaluation_id is not None:
        input_["resource_evaluation_id"] = resource_evaluation_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output