Skip to content

update_enabled_control

update_enabled_control(
    parameters: EnabledControlParameters,
    enabled_control_identifier: Arn,
    *,
    config_overrides: Optional[ControlTowerClientConfig] = None,
) -> UpdateEnabledControlOutput

Updates the configuration of an already enabled control.

If the enabled control shows an EnablementStatus of SUCCEEDED, supply parameters that are different from the currently configured parameters. Otherwise, Amazon Web Services Control Tower will not accept the request.

If the enabled control shows an EnablementStatus of FAILED, Amazon Web Services Control Tower updates the control to match any valid parameters that you supply.

If the DriftSummary status for the control shows as DRIFTED, you cannot call this API. Instead, you can update the control by calling the ResetEnabledControl API. Alternatively, you can call DisableControl and then call EnableControl again. Also, you can run an extending governance operation to repair drift. For usage examples, see the Controls Reference Guide .

Parameters:

  • parameters (EnabledControlParameters) –

    A key/value pair, where Key is of type String and Value is of type Document.

  • enabled_control_identifier (Arn) –

    The ARN of the enabled control that will be updated.

Raises:

Source code in docs_src/capo_controltower/_services/control_tower.py
def update_enabled_control(
    self,
    parameters: "capo_controltower.types.enabled_control_parameters.EnabledControlParameters",
    enabled_control_identifier: "capo_controltower.types.arn.Arn",
    *,
    config_overrides: Optional[ControlTowerClientConfig] = None,
) -> "capo_controltower.types.update_enabled_control_output.UpdateEnabledControlOutput":
    """<p> Updates the configuration of an already enabled control.</p> <p>If the enabled control shows an <code>EnablementStatus</code> of SUCCEEDED, supply parameters that are different from the currently configured parameters. Otherwise, Amazon Web Services Control Tower will not accept the request.</p> <p>If the enabled control shows an <code>EnablementStatus</code> of FAILED, Amazon Web Services Control Tower updates the control to match any valid parameters that you supply.</p> <p>If the <code>DriftSummary</code> status for the control shows as <code>DRIFTED</code>, you cannot call this API. Instead, you can update the control by calling the <code>ResetEnabledControl</code> API. Alternatively, you can call <code>DisableControl</code> and then call <code>EnableControl</code> again. Also, you can run an extending governance operation to repair drift. 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:
        parameters: <p>A key/value pair, where <code>Key</code> is of type <code>String</code> and <code>Value</code> is of type <code>Document</code>.</p>
        enabled_control_identifier: <p> The ARN of the enabled control that will be updated. </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.update_enabled_control_input.UpdateEnabledControlInput]",
    ) -> OperationResponse[
        "capo_controltower.types.update_enabled_control_output.UpdateEnabledControlOutput"
    ]:
        import capo_controltower._operations.aws_control_tower_apis.update_enabled_control

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEnabledControl")
    )
    input_: capo_controltower.types.update_enabled_control_input.UpdateEnabledControlInput = {
        "parameters": parameters,
        "enabled_control_identifier": enabled_control_identifier,
    }

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