Update deletion protection to either allow or deny deletion of the final Region in a replication set.
Parameters:
-
arn
(Arn)
–
The Amazon Resource Name (ARN) of the replication set to update.
-
deletion_protected
(bool)
–
Specifies if deletion protection is turned on or off in your account.
-
client_token
(Optional[ClientToken], default:
None
)
–
A token that ensures that the operation is called only once with the specified details.
Raises:
Source code in docs_src/capo_ssm_incidents/_services/ssm_incidents.py
| def update_deletion_protection(
self,
arn: "capo_ssm_incidents.types.arn.Arn",
deletion_protected: bool,
*,
config_overrides: Optional[SSMIncidentsClientConfig] = None,
client_token: Optional[
"capo_ssm_incidents.types.client_token.ClientToken"
] = None,
) -> "capo_ssm_incidents.types.update_deletion_protection_output.UpdateDeletionProtectionOutput":
"""<p>Update deletion protection to either allow or deny deletion of the final Region in a replication set.</p>
Args:
arn: <p>The Amazon Resource Name (ARN) of the replication set to update.</p>
deletion_protected: <p>Specifies if deletion protection is turned on or off in your account. </p>
client_token: <p>A token that ensures that the operation is called only once with the specified details.</p>
Raises:
capo_ssm_incidents.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation.</p>
capo_ssm_incidents.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
capo_ssm_incidents.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which doesn't exist. </p>
capo_ssm_incidents.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_ssm_incidents.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_ssm_incidents.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_ssm_incidents.types.update_deletion_protection_input.UpdateDeletionProtectionInput]",
) -> OperationResponse[
"capo_ssm_incidents.types.update_deletion_protection_output.UpdateDeletionProtectionOutput"
]:
import capo_ssm_incidents._operations.ssm_incidents.update_deletion_protection
output, http_response = (
capo_ssm_incidents._operations.ssm_incidents.update_deletion_protection.update_deletion_protection(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateDeletionProtection")
)
input_: capo_ssm_incidents.types.update_deletion_protection_input.UpdateDeletionProtectionInput = {
"arn": arn,
"deletion_protected": deletion_protected,
}
if client_token is None:
client_token = str(uuid.uuid4())
input_["client_token"] = client_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|