Skip to content

list_resource_scan_related_resources

list_resource_scan_related_resources(
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    resource_scan_id: Optional[ResourceScanId] = None,
    resources: Optional[ScannedResourceIdentifiers] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[BoxedMaxResults] = None,
) -> ListResourceScanRelatedResourcesOutput

Lists the related resources for a list of resources from a resource scan. 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.

  • resources (Optional[ScannedResourceIdentifiers], default: None ) –

    The list of resources for which you want to get the related resources. Up to 100 resources can be provided.

  • 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[BoxedMaxResults], 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 ListResourceScanRelatedResources API action will return up to 100 results in each response. The maximum value is 100.

Raises:

Examples:

To list resource scan related resources This example lists the resources related to the passed in resources

>>> client.list_resource_scan_related_resources(resource_scan_id='arn:aws:cloudformation:us-east-1:123456789012:resourceScan/c19304f6-c4f1-4ff8-8e1f-35162e41d7e1', resources=[{'ResourceType': 'AWS::S3::Bucket', 'ResourceIdentifier': {'BucketName': 'jazz-bucket'}}, {'ResourceType': 'AWS::EC2::DHCPOptions', 'ResourceIdentifier': {'DhcpOptionsId': 'random-id123'}}])
Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
def list_resource_scan_related_resources(
    self,
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    resource_scan_id: Optional[
        "capo_cloudformation.types.resource_scan_id.ResourceScanId"
    ] = None,
    resources: Optional[
        "capo_cloudformation.types.scanned_resource_identifiers.ScannedResourceIdentifiers"
    ] = None,
    next_token: Optional["capo_cloudformation.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_cloudformation.types.boxed_max_results.BoxedMaxResults"
    ] = None,
) -> "capo_cloudformation.types.list_resource_scan_related_resources_output.ListResourceScanRelatedResourcesOutput":
    """<p>Lists the related resources for a list of resources from a resource scan. 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>
        resources: <p>The list of resources for which you want to get the related resources. Up to 100 resources can be provided.</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>ListResourceScanRelatedResources</code> API action will return up to 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 resource scan related resources
        This example lists the resources related to the passed in resources

        >>> client.list_resource_scan_related_resources(resource_scan_id='arn:aws:cloudformation:us-east-1:123456789012:resourceScan/c19304f6-c4f1-4ff8-8e1f-35162e41d7e1', resources=[{'ResourceType': 'AWS::S3::Bucket', 'ResourceIdentifier': {'BucketName': 'jazz-bucket'}}, {'ResourceType': 'AWS::EC2::DHCPOptions', 'ResourceIdentifier': {'DhcpOptionsId': 'random-id123'}}])
    """

    def _handler(
        req: "OperationRequest[capo_cloudformation.types.list_resource_scan_related_resources_input.ListResourceScanRelatedResourcesInput]",
    ) -> OperationResponse[
        "capo_cloudformation.types.list_resource_scan_related_resources_output.ListResourceScanRelatedResourcesOutput"
    ]:
        import capo_cloudformation._operations.cloud_formation.list_resource_scan_related_resources

        output, http_response = (
            capo_cloudformation._operations.cloud_formation.list_resource_scan_related_resources.list_resource_scan_related_resources(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListResourceScanRelatedResources")
    )
    input_: capo_cloudformation.types.list_resource_scan_related_resources_input.ListResourceScanRelatedResourcesInput = {}
    if resource_scan_id is not None:
        input_["resource_scan_id"] = resource_scan_id
    if resources is not None:
        input_["resources"] = resources
    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