Skip to content

list_findings

list_findings(
    analyzer_arn: AnalyzerArn,
    *,
    config_overrides: Optional[AccessAnalyzerClientConfig] = None,
    filter: Optional[FilterCriteriaMap] = None,
    sort: Optional[SortCriteria] = None,
    next_token: Optional[Token] = None,
    max_results: Optional[int] = None,
) -> ListFindingsResponse

Retrieves a list of findings generated by the specified analyzer. ListFindings and ListFindingsV2 both use access-analyzer:ListFindings in the Action element of an IAM policy statement. You must have permission to perform the access-analyzer:ListFindings action.

To learn about filter keys that you can use to retrieve a list of findings, see IAM Access Analyzer filter keys in the IAM User Guide.

ListFindings is supported only for external access analyzers. You must use ListFindingsV2 for internal and unused access analyzers.

Parameters:

Raises:

Source code in docs_src/capo_accessanalyzer/_services/access_analyzer.py
def list_findings(
    self,
    analyzer_arn: "capo_accessanalyzer.types.analyzer_arn.AnalyzerArn",
    *,
    config_overrides: Optional[AccessAnalyzerClientConfig] = None,
    filter: Optional[
        "capo_accessanalyzer.types.filter_criteria_map.FilterCriteriaMap"
    ] = None,
    sort: Optional["capo_accessanalyzer.types.sort_criteria.SortCriteria"] = None,
    next_token: Optional["capo_accessanalyzer.types.token.Token"] = None,
    max_results: Optional[int] = None,
) -> "capo_accessanalyzer.types.list_findings_response.ListFindingsResponse":
    """<p>Retrieves a list of findings generated by the specified analyzer. ListFindings and ListFindingsV2 both use <code>access-analyzer:ListFindings</code> in the <code>Action</code> element of an IAM policy statement. You must have permission to perform the <code>access-analyzer:ListFindings</code> action.</p> <p>To learn about filter keys that you can use to retrieve a list of findings, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html">IAM Access Analyzer filter keys</a> in the <b>IAM User Guide</b>.</p> <note> <p>ListFindings is supported only for external access analyzers. You must use ListFindingsV2 for internal and unused access analyzers.</p> </note>

    Args:
        analyzer_arn: <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN of the analyzer</a> to retrieve findings from.</p>
        filter: <p>A filter to match for the findings to return.</p>
        sort: <p>The sort order for the findings returned.</p>
        next_token: <p>A token used for pagination of results returned.</p>
        max_results: <p>The maximum number of results to return in the response.</p>

    Raises:
        capo_accessanalyzer.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_accessanalyzer.errors.internal_server_exception.InternalServerException: <p>Internal server error.</p>
        capo_accessanalyzer.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_accessanalyzer.errors.throttling_exception.ThrottlingException: <p>Throttling limit exceeded error.</p>
        capo_accessanalyzer.errors.validation_exception.ValidationException: <p>Validation exception error.</p>
        capo_accessanalyzer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_accessanalyzer.types.list_findings_request.ListFindingsRequest]",
    ) -> OperationResponse[
        "capo_accessanalyzer.types.list_findings_response.ListFindingsResponse"
    ]:
        import capo_accessanalyzer._operations.access_analyzer.list_findings

        output, http_response = (
            capo_accessanalyzer._operations.access_analyzer.list_findings.list_findings(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListFindings")
    )
    input_: capo_accessanalyzer.types.list_findings_request.ListFindingsRequest = {
        "analyzer_arn": analyzer_arn
    }
    if filter is not None:
        input_["filter"] = filter
    if sort is not None:
        input_["sort"] = sort
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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