Skip to content

enable_control

enable_control(
    control_identifier: ControlIdentifier,
    target_identifier: TargetIdentifier,
    *,
    config_overrides: Optional[ControlTowerClientConfig] = None,
    tags: Optional[TagMap] = None,
    parameters: Optional[EnabledControlParameters] = None,
) -> EnableControlOutput

This API call activates a control. It starts an asynchronous operation that creates Amazon Web Services resources on the specified organizational unit and the accounts it contains. The resources created will vary according to the control that you specify. For usage examples, see the Controls Reference Guide .

Parameters:

  • control_identifier (ControlIdentifier) –

    The ARN of the control. Only Strongly recommended and Elective controls are permitted, with the exception of the Region deny control. For information on how to find the controlIdentifier, see the overview page.

  • target_identifier (TargetIdentifier) –

    The ARN of the organizational unit. For information on how to find the targetIdentifier, see the overview page.

  • tags (Optional[TagMap], default: None ) –

    Tags to be applied to the EnabledControl resource.

  • parameters (Optional[EnabledControlParameters], default: None ) –

    A list of input parameter values, which are specified to configure the control when you enable it.

Raises:

Source code in docs_src/capo_controltower/_services/control_tower.py
def enable_control(
    self,
    control_identifier: "capo_controltower.types.control_identifier.ControlIdentifier",
    target_identifier: "capo_controltower.types.target_identifier.TargetIdentifier",
    *,
    config_overrides: Optional[ControlTowerClientConfig] = None,
    tags: Optional["capo_controltower.types.tag_map.TagMap"] = None,
    parameters: Optional[
        "capo_controltower.types.enabled_control_parameters.EnabledControlParameters"
    ] = None,
) -> "capo_controltower.types.enable_control_output.EnableControlOutput":
    """<p>This API call activates a control. It starts an asynchronous operation that creates Amazon Web Services resources on the specified organizational unit and the accounts it contains. The resources created will vary according to the control that you specify. 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:
        control_identifier: <p>The ARN of the control. Only <b>Strongly recommended</b> and <b>Elective</b> controls are permitted, with the exception of the <b>Region deny</b> control. For information on how to find the <code>controlIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
        target_identifier: <p>The ARN of the organizational unit. 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>
        tags: <p>Tags to be applied to the <code>EnabledControl</code> resource.</p>
        parameters: <p>A list of input parameter values, which are specified to configure the control when you enable it.</p>

    Raises:
        capo_controltower.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_controltower.errors.conflict_exception.ConflictException: <p>Updating or deleting the resource can cause an inconsistent state.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would cause a service quota to be exceeded. See <a href="https://docs.aws.amazon.com/controltower/latest/userguide/request-an-increase.html">Service quotas</a>.</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.
    """

    def _handler(
        req: "OperationRequest[capo_controltower.types.enable_control_input.EnableControlInput]",
    ) -> OperationResponse[
        "capo_controltower.types.enable_control_output.EnableControlOutput"
    ]:
        import capo_controltower._operations.aws_control_tower_apis.enable_control

        output, http_response = (
            capo_controltower._operations.aws_control_tower_apis.enable_control.enable_control(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("EnableControl")
    )
    input_: capo_controltower.types.enable_control_input.EnableControlInput = {
        "control_identifier": control_identifier,
        "target_identifier": target_identifier,
    }
    if tags is not None:
        input_["tags"] = tags
    if parameters is not None:
        input_["parameters"] = parameters

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