Skip to content

list_control_resources

list_control_resources(
    environment_arn: EnvironmentArn,
    framework: FrameworkName,
    framework_version: FrameworkVersion,
    control_id: ControlID,
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    project: Optional[ProjectName] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListControlResourcesOutput

Lists the resources that are in scope for the automated evaluation of a control. If no resource types apply to the control, the list is empty.

Parameters:

  • environment_arn (EnvironmentArn) –

    The Amazon Resource Name (ARN) of this governance environment.

  • framework (FrameworkName) –

    The name of the compliance framework.

  • framework_version (FrameworkVersion) –

    The version of the compliance framework.

  • control_id (ControlID) –

    The identifier of the control.

  • project (Optional[ProjectName], default: None ) –

    Optional project scope. When provided, only resources that match the project's resource filters are considered. When omitted, all of the environment's resources are considered.

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

    The maximum number of results to return on one page. The default is 50. If more results are available, use the nextToken value from the response to get the next page.

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

    The pagination token returned by a previous request. Use it to retrieve the next page of results.

Raises:

Examples:

List resources in scope for a control Lists the resources discovered for the payments-prod project that a PCI DSS control is evaluated against during an automated scan.

>>> client.list_control_resources(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', framework='AWS:PCI-DSS', framework_version='4', control_id='8.2.1', project='payments-prod')
Source code in docs_src/capo_assurance/_services/assurance.py
def list_control_resources(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    framework: "capo_assurance.types.framework_name.FrameworkName",
    framework_version: "capo_assurance.types.framework_version.FrameworkVersion",
    control_id: "capo_assurance.types.control_id.ControlID",
    *,
    config_overrides: Optional[AssuranceClientConfig] = None,
    project: Optional["capo_assurance.types.project_name.ProjectName"] = None,
    max_results: Optional["capo_assurance.types.max_results.MaxResults"] = None,
    next_token: Optional[
        "capo_assurance.types.pagination_token.PaginationToken"
    ] = None,
) -> (
    "capo_assurance.types.list_control_resources_output.ListControlResourcesOutput"
):
    """<p>Lists the resources that are in scope for the automated evaluation of a control. If no resource types apply to the control, the list is empty.</p>

    Args:
        environment_arn: <p>The Amazon Resource Name (ARN) of this governance environment.</p>
        framework: <p>The name of the compliance framework.</p>
        framework_version: <p>The version of the compliance framework.</p>
        control_id: <p>The identifier of the control.</p>
        project: <p>Optional project scope. When provided, only resources that match the project's resource filters are considered. When omitted, all of the environment's resources are considered.</p>
        max_results: <p>The maximum number of results to return on one page. The default is 50. If more results are available, use the <code>nextToken</code> value from the response to get the next page.</p>
        next_token: <p>The pagination token returned by a previous request. Use it to retrieve the next page of results.</p>

    Raises:
        capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
        capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
        capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
        capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
        capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List resources in scope for a control
        Lists the resources discovered for the payments-prod project that a PCI DSS control is evaluated against during an automated scan.

        >>> client.list_control_resources(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', framework='AWS:PCI-DSS', framework_version='4', control_id='8.2.1', project='payments-prod')
    """

    def _handler(
        req: "OperationRequest[capo_assurance.types.list_control_resources_input.ListControlResourcesInput]",
    ) -> OperationResponse[
        "capo_assurance.types.list_control_resources_output.ListControlResourcesOutput"
    ]:
        import capo_assurance._operations.assurance.list_control_resources

        output, http_response = (
            capo_assurance._operations.assurance.list_control_resources.list_control_resources(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListControlResources")
    )
    input_: capo_assurance.types.list_control_resources_input.ListControlResourcesInput = {
        "environment_arn": environment_arn,
        "framework": framework,
        "framework_version": framework_version,
        "control_id": control_id,
    }
    if project is not None:
        input_["project"] = project
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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