This API call turns off a control. It starts an asynchronous operation that deletes Amazon Web Services resources on the specified organizational unit and the accounts it contains. The resources will vary according to the control that you specify. For usage examples, see the Controls Reference Guide .
Parameters:
-
control_identifier
(Optional[ControlIdentifier], default:
None
)
–
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
(Optional[TargetIdentifier], default:
None
)
–
The ARN of the organizational unit. For information on how to find the targetIdentifier, see the overview page.
-
enabled_control_identifier
(Optional[Arn], default:
None
)
–
The ARN of the enabled control to be disabled, which uniquely identifies the control instance on the target organizational unit.
Raises:
Source code in docs_src/capo_controltower/_services/control_tower.py
| def disable_control(
self,
*,
config_overrides: Optional[ControlTowerClientConfig] = None,
control_identifier: Optional[
"capo_controltower.types.control_identifier.ControlIdentifier"
] = None,
target_identifier: Optional[
"capo_controltower.types.target_identifier.TargetIdentifier"
] = None,
enabled_control_identifier: Optional["capo_controltower.types.arn.Arn"] = None,
) -> "capo_controltower.types.disable_control_output.DisableControlOutput":
"""<p>This API call turns off a control. It starts an asynchronous operation that deletes Amazon Web Services resources on the specified organizational unit and the accounts it contains. The resources 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>
enabled_control_identifier: <p>The ARN of the enabled control to be disabled, which uniquely identifies the control instance on the target organizational unit.</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.disable_control_input.DisableControlInput]",
) -> OperationResponse[
"capo_controltower.types.disable_control_output.DisableControlOutput"
]:
import capo_controltower._operations.aws_control_tower_apis.disable_control
output, http_response = (
capo_controltower._operations.aws_control_tower_apis.disable_control.disable_control(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DisableControl")
)
input_: capo_controltower.types.disable_control_input.DisableControlInput = {}
if control_identifier is not None:
input_["control_identifier"] = control_identifier
if target_identifier is not None:
input_["target_identifier"] = target_identifier
if enabled_control_identifier is not None:
input_["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
|