Skip to content

update_routing_control_states async

update_routing_control_states(
    update_routing_control_state_entries: UpdateRoutingControlStateEntries,
    *,
    config_overrides: Optional[AsyncRoute53RecoveryClusterClientConfig] = None,
    safety_rules_to_override: Optional[Arns] = None,
) -> UpdateRoutingControlStatesResponse

Set multiple routing control states. You can set the value for each state to be ON or OFF. When the state is ON, traffic flows to a cell. When it's 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:

  • update_routing_control_state_entries (UpdateRoutingControlStateEntries) –

    A set of routing control entries that you want to update.

  • 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 routing control states. 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_states(
    self,
    update_routing_control_state_entries: "capo_route53_recovery_cluster.types.update_routing_control_state_entries.UpdateRoutingControlStateEntries",
    *,
    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_states_response.UpdateRoutingControlStatesResponse":
    """<p>Set multiple routing control states. You can set the value for each state to be ON or OFF. When the state is ON, traffic flows to a cell. When it's 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:
        update_routing_control_state_entries: <p>A set of routing control entries that you want to update.</p>
        safety_rules_to_override: <p>The Amazon Resource Names (ARNs) for the safety rules that you want to override when you're updating routing control states. 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.service_limit_exceeded_exception.ServiceLimitExceededException: <p>The request can't update that many routing control states at the same time. Try again with fewer routing control states.</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_states_request.UpdateRoutingControlStatesRequest]",
    ) -> AsyncOperationResponse[
        "capo_route53_recovery_cluster.types.update_routing_control_states_response.UpdateRoutingControlStatesResponse"
    ]:
        import capo_route53_recovery_cluster._operations.toggle_customer_api.update_routing_control_states

        (
            output,
            http_response,
        ) = await capo_route53_recovery_cluster._operations.toggle_customer_api.update_routing_control_states.async_update_routing_control_states(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateRoutingControlStates")
    )
    input_: capo_route53_recovery_cluster.types.update_routing_control_states_request.UpdateRoutingControlStatesRequest = {
        "update_routing_control_state_entries": update_routing_control_state_entries
    }
    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