Set the state of the routing control to reroute traffic. You can set the value to ON or OFF. When the state is ON, traffic flows to a cell. When the state is OFF, traffic does not flow.
With Route 53 ARC, you can add safety rules for routing controls, which are safeguards for routing control state updates that help prevent unexpected outcomes, like fail open traffic routing. However, there are scenarios when you might want to bypass the routing control safeguards that are enforced with safety rules that you've configured. For example, you might want to fail over quickly for disaster recovery, and one or more safety rules might be unexpectedly preventing you from updating a routing control state to reroute traffic. In a "break glass" scenario like this, you can override one or more safety rules to change a routing control state and fail over your application.
The SafetyRulesToOverride property enables you override one or more safety rules and update routing control states. For more information, see Override safety rules to reroute traffic in the Amazon Route 53 Application Recovery Controller Developer Guide.
You must specify Regional endpoints when you work with API cluster operations to get or update routing control states in Route 53 ARC.
To see a code example for getting a routing control state, including accessing Regional cluster endpoints in sequence, see API examples in the Amazon Route 53 Application Recovery Controller Developer Guide.
Parameters:
-
routing_control_arn
(Arn)
–
The Amazon Resource Name (ARN) for the routing control that you want to update the state for.
-
routing_control_state
(RoutingControlState)
–
The state of the routing control. You can set the value to ON or OFF.
-
safety_rules_to_override
(Optional[Arns], default:
None
)
–
The Amazon Resource Names (ARNs) for the safety rules that you want to override when you're updating the state of a routing control. You can override one safety rule or multiple safety rules by including one or more ARNs, separated by commas.
For more information, see Override safety rules to reroute traffic in the Amazon Route 53 Application Recovery Controller Developer Guide.
Raises:
Source code in docs_src/capo_route53_recovery_cluster/_services/async_route53_recovery_cluster.py
| async def update_routing_control_state(
self,
routing_control_arn: "capo_route53_recovery_cluster.types.arn.Arn",
routing_control_state: "capo_route53_recovery_cluster.types.routing_control_state.RoutingControlState",
*,
config_overrides: Optional[AsyncRoute53RecoveryClusterClientConfig] = None,
safety_rules_to_override: Optional[
"capo_route53_recovery_cluster.types.arns.Arns"
] = None,
) -> "capo_route53_recovery_cluster.types.update_routing_control_state_response.UpdateRoutingControlStateResponse":
"""<p>Set the state of the routing control to reroute traffic. You can set the value to ON or OFF. When the state is ON, traffic flows to a cell. When the state is OFF, traffic does not flow.</p> <p>With Route 53 ARC, you can add safety rules for routing controls, which are safeguards for routing control state updates that help prevent unexpected outcomes, like fail open traffic routing. However, there are scenarios when you might want to bypass the routing control safeguards that are enforced with safety rules that you've configured. For example, you might want to fail over quickly for disaster recovery, and one or more safety rules might be unexpectedly preventing you from updating a routing control state to reroute traffic. In a "break glass" scenario like this, you can override one or more safety rules to change a routing control state and fail over your application.</p> <p>The <code>SafetyRulesToOverride</code> property enables you override one or more safety rules and update routing control states. For more information, see <a href="https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.override-safety-rule.html"> Override safety rules to reroute traffic</a> in the Amazon Route 53 Application Recovery Controller Developer Guide.</p> <p> <i>You must specify Regional endpoints when you work with API cluster operations to get or update routing control states in Route 53 ARC.</i> </p> <p>To see a code example for getting a routing control state, including accessing Regional cluster endpoints in sequence, see <a href="https://docs.aws.amazon.com/r53recovery/latest/dg/service_code_examples_actions.html">API examples</a> in the Amazon Route 53 Application Recovery Controller Developer Guide.</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.update.html"> Viewing and updating routing control states</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.html">Working with routing controls overall</a> </p> </li> </ul>
Args:
routing_control_arn: <p>The Amazon Resource Name (ARN) for the routing control that you want to update the state for.</p>
routing_control_state: <p>The state of the routing control. You can set the value to ON or OFF.</p>
safety_rules_to_override: <p>The Amazon Resource Names (ARNs) for the safety rules that you want to override when you're updating the state of a routing control. You can override one safety rule or multiple safety rules by including one or more ARNs, separated by commas.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.override-safety-rule.html"> Override safety rules to reroute traffic</a> in the Amazon Route 53 Application Recovery Controller Developer Guide.</p>
Raises:
capo_route53_recovery_cluster.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
capo_route53_recovery_cluster.errors.conflict_exception.ConflictException: <p>There was a conflict with this request. Try again.</p>
capo_route53_recovery_cluster.errors.endpoint_temporarily_unavailable_exception.EndpointTemporarilyUnavailableException: <p>The cluster endpoint isn't available. Try another cluster endpoint.</p>
capo_route53_recovery_cluster.errors.internal_server_exception.InternalServerException: <p>There was an unexpected error during processing of the request.</p>
capo_route53_recovery_cluster.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a routing control or control panel that was not found.</p>
capo_route53_recovery_cluster.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling.</p>
capo_route53_recovery_cluster.errors.validation_exception.ValidationException: <p>There was a validation error on the request.</p>
capo_route53_recovery_cluster.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_route53_recovery_cluster.types.update_routing_control_state_request.UpdateRoutingControlStateRequest]",
) -> AsyncOperationResponse[
"capo_route53_recovery_cluster.types.update_routing_control_state_response.UpdateRoutingControlStateResponse"
]:
import capo_route53_recovery_cluster._operations.toggle_customer_api.update_routing_control_state
(
output,
http_response,
) = await capo_route53_recovery_cluster._operations.toggle_customer_api.update_routing_control_state.async_update_routing_control_state(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateRoutingControlState")
)
input_: capo_route53_recovery_cluster.types.update_routing_control_state_request.UpdateRoutingControlStateRequest = {
"routing_control_arn": routing_control_arn,
"routing_control_state": routing_control_state,
}
if safety_rules_to_override is not None:
input_["safety_rules_to_override"] = safety_rules_to_override
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|