Skip to content

list_resource_scan_resources async

list_resource_scan_resources(
    *,
    config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
    resource_scan_id: Optional[ResourceScanId] = None,
    resource_identifier: Optional[ResourceIdentifier] = None,
    resource_type_prefix: Optional[ResourceTypePrefix] = None,
    tag_key: Optional[TagKey] = None,
    tag_value: Optional[TagValue] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[ResourceScannerMaxResults] = None,
) -> ListResourceScanResourcesOutput

Lists the resources from a resource scan. The results can be filtered by resource identifier, resource type prefix, tag key, and tag value. Only resources that match all specified filters are returned. The response indicates whether each returned resource is already managed by CloudFormation.

Parameters:

  • resource_scan_id (Optional[ResourceScanId], default: None ) –

    The Amazon Resource Name (ARN) of the resource scan.

  • resource_identifier (Optional[ResourceIdentifier], default: None ) –

    If specified, the returned resources will have the specified resource identifier (or one of them in the case where the resource has multiple identifiers).

  • resource_type_prefix (Optional[ResourceTypePrefix], default: None ) –

    If specified, the returned resources will be of any of the resource types with the specified prefix.

  • tag_key (Optional[TagKey], default: None ) –

    If specified, the returned resources will have a matching tag key.

  • tag_value (Optional[TagValue], default: None ) –

    If specified, the returned resources will have a matching tag value.

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

    The token for the next set of items to return. (You received this token from a previous call.)

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

    If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListResourceScanResources API action will return at most 100 results in each response. The maximum value is 100.

Raises:

Examples:

To list the resources in your resource scan This example lists the resources in your resource scan

>>> await client.list_resource_scan_resources(resource_scan_id='arn:aws:cloudformation:us-east-1:123456789012:resourceScan/c19304f6-c4f1-4ff8-8e1f-35162e41d7e1')
To list the resources in your resource scan for specific resource type
This example lists the resources in your resource scan filtering only the resources that start with the passed in prefix
>>> await client.list_resource_scan_resources(resource_scan_id='arn:aws:cloudformation:us-east-1:123456789012:resourceScan/c19304f6-c4f1-4ff8-8e1f-35162e41d7e1', resource_type_prefix='AWS::S3')
Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
async def list_resource_scan_resources(
    self,
    *,
    config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
    resource_scan_id: Optional[
        "capo_cloudformation.types.resource_scan_id.ResourceScanId"
    ] = None,
    resource_identifier: Optional[
        "capo_cloudformation.types.resource_identifier.ResourceIdentifier"
    ] = None,
    resource_type_prefix: Optional[
        "capo_cloudformation.types.resource_type_prefix.ResourceTypePrefix"
    ] = None,
    tag_key: Optional["capo_cloudformation.types.tag_key.TagKey"] = None,
    tag_value: Optional["capo_cloudformation.types.tag_value.TagValue"] = None,
    next_token: Optional["capo_cloudformation.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_cloudformation.types.resource_scanner_max_results.ResourceScannerMaxResults"
    ] = None,
) -> "capo_cloudformation.types.list_resource_scan_resources_output.ListResourceScanResourcesOutput":
    """<p>Lists the resources from a resource scan. The results can be filtered by resource identifier, resource type prefix, tag key, and tag value. Only resources that match all specified filters are returned. The response indicates whether each returned resource is already managed by CloudFormation.</p>

    Args:
        resource_scan_id: <p>The Amazon Resource Name (ARN) of the resource scan.</p>
        resource_identifier: <p>If specified, the returned resources will have the specified resource identifier (or one of them in the case where the resource has multiple identifiers).</p>
        resource_type_prefix: <p>If specified, the returned resources will be of any of the resource types with the specified prefix.</p>
        tag_key: <p>If specified, the returned resources will have a matching tag key.</p>
        tag_value: <p>If specified, the returned resources will have a matching tag value.</p>
        next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
        max_results: <p>If the number of available results exceeds this maximum, the response includes a <code>NextToken</code> value that you can use for the <code>NextToken</code> parameter to get the next set of results. By default the <code>ListResourceScanResources</code> API action will return at most 100 results in each response. The maximum value is 100.</p>

    Raises:
        capo_cloudformation.errors.resource_scan_in_progress_exception.ResourceScanInProgressException: <p>A resource scan is currently in progress. Only one can be run at a time for an account in a Region.</p>
        capo_cloudformation.errors.resource_scan_not_found_exception.ResourceScanNotFoundException: <p>The resource scan was not found.</p>
        capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list the resources in your resource scan
        This example lists the resources in your resource scan

        >>> await client.list_resource_scan_resources(resource_scan_id='arn:aws:cloudformation:us-east-1:123456789012:resourceScan/c19304f6-c4f1-4ff8-8e1f-35162e41d7e1')
        To list the resources in your resource scan for specific resource type
        This example lists the resources in your resource scan filtering only the resources that start with the passed in prefix

        >>> await client.list_resource_scan_resources(resource_scan_id='arn:aws:cloudformation:us-east-1:123456789012:resourceScan/c19304f6-c4f1-4ff8-8e1f-35162e41d7e1', resource_type_prefix='AWS::S3')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudformation.types.list_resource_scan_resources_input.ListResourceScanResourcesInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudformation.types.list_resource_scan_resources_output.ListResourceScanResourcesOutput"
    ]:
        import capo_cloudformation._operations.cloud_formation.list_resource_scan_resources

        (
            output,
            http_response,
        ) = await capo_cloudformation._operations.cloud_formation.list_resource_scan_resources.async_list_resource_scan_resources(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListResourceScanResources")
    )
    input_: capo_cloudformation.types.list_resource_scan_resources_input.ListResourceScanResourcesInput = {}
    if resource_scan_id is not None:
        input_["resource_scan_id"] = resource_scan_id
    if resource_identifier is not None:
        input_["resource_identifier"] = resource_identifier
    if resource_type_prefix is not None:
        input_["resource_type_prefix"] = resource_type_prefix
    if tag_key is not None:
        input_["tag_key"] = tag_key
    if tag_value is not None:
        input_["tag_value"] = tag_value
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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