Skip to content

list_enabled_controls async

list_enabled_controls(
    *,
    config_overrides: Optional[AsyncControlTowerClientConfig] = None,
    target_identifier: Optional[TargetIdentifier] = None,
    next_token: Optional[str] = None,
    max_results: Optional[MaxResults] = None,
    filter: Optional[EnabledControlFilter] = None,
    include_children: Optional[bool] = None,
) -> ListEnabledControlsOutput

Lists the controls enabled by Amazon Web Services Control Tower on the specified organizational unit and the accounts it contains. For usage examples, see the Controls Reference Guide .

Parameters:

  • target_identifier (Optional[TargetIdentifier], default: None ) –

    The ARN of the target. The value depends on the target type:

    • Organizational unit (OU) – Specify the ARN of the OU.

    • Account – Specify the ARN of the account.

    For information on how to find the targetIdentifier, see the overview page.

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

    The token to continue the list from a previous API call with the same parameters.

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

    How many results to return per API call.

  • filter (Optional[EnabledControlFilter], default: None ) –

    An input filter for the ListEnabledControls API that lets you select the types of control operations to view.

  • include_children (Optional[bool], default: None ) –

    Specifies whether to include enabled controls from child organizational units and child accounts in the response.

Raises:

Source code in docs_src/capo_controltower/_services/async_control_tower.py
async def list_enabled_controls(
    self,
    *,
    config_overrides: Optional[AsyncControlTowerClientConfig] = None,
    target_identifier: Optional[
        "capo_controltower.types.target_identifier.TargetIdentifier"
    ] = None,
    next_token: Optional[str] = None,
    max_results: Optional["capo_controltower.types.max_results.MaxResults"] = None,
    filter: Optional[
        "capo_controltower.types.enabled_control_filter.EnabledControlFilter"
    ] = None,
    include_children: Optional[bool] = None,
) -> (
    "capo_controltower.types.list_enabled_controls_output.ListEnabledControlsOutput"
):
    """<p>Lists the controls enabled by Amazon Web Services Control Tower on the specified organizational unit and the accounts it contains. For usage examples, see the <a href="https://docs.aws.amazon.com/controltower/latest/controlreference/control-api-examples-short.html"> <i>Controls Reference Guide</i> </a>.</p>

    Args:
        target_identifier: <p>The ARN of the target. The value depends on the target type:</p> <ul> <li> <p>Organizational unit (OU) – Specify the ARN of the OU.</p> </li> <li> <p>Account – Specify the ARN of the account.</p> </li> </ul> <p>For information on how to find the <code>targetIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
        next_token: <p>The token to continue the list from a previous API call with the same parameters.</p>
        max_results: <p>How many results to return per API call.</p>
        filter: <p>An input filter for the <code>ListEnabledControls</code> API that lets you select the types of control operations to view.</p>
        include_children: <p>Specifies whether to include enabled controls from child organizational units and child accounts in the response.</p>

    Raises:
        capo_controltower.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_controltower.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during processing of a request.</p>
        capo_controltower.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that does not exist.</p>
        capo_controltower.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_controltower.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_controltower.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_controltower.types.list_enabled_controls_input.ListEnabledControlsInput]",
    ) -> AsyncOperationResponse[
        "capo_controltower.types.list_enabled_controls_output.ListEnabledControlsOutput"
    ]:
        import capo_controltower._operations.aws_control_tower_apis.list_enabled_controls

        (
            output,
            http_response,
        ) = await capo_controltower._operations.aws_control_tower_apis.list_enabled_controls.async_list_enabled_controls(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListEnabledControls")
    )
    input_: capo_controltower.types.list_enabled_controls_input.ListEnabledControlsInput = {}
    if target_identifier is not None:
        input_["target_identifier"] = target_identifier
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if filter is not None:
        input_["filter"] = filter
    if include_children is not None:
        input_["include_children"] = include_children

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