Skip to content

create_routing_control

create_routing_control(
    *,
    config_overrides: Optional[Route53RecoveryControlConfigClientConfig] = None,
    client_token: Optional[__stringMin1Max64PatternS] = None,
    cluster_arn: Optional[__stringMin1Max256PatternAZaZ09] = None,
    control_panel_arn: Optional[__stringMin1Max256PatternAZaZ09] = None,
    routing_control_name: Optional[__stringMin1Max64PatternS] = None,
) -> CreateRoutingControlResponse

Creates a new routing control.

A routing control has one of two states: ON and OFF. You can map the routing control state to the state of an Amazon Route 53 health check, which can be used to control traffic routing.

To get or update the routing control state, see the Recovery Cluster (data plane) API actions for Amazon Route 53 Application Recovery Controller.

Parameters:

Raises:

  • AccessDeniedException –

    403 response - You do not have sufficient access to perform this action.

  • ConflictException –

    409 response - ConflictException. You might be using a predefined variable.

  • InternalServerException –

    500 response - InternalServiceError. Temporary service error. Retry the request.

  • ResourceNotFoundException –

    404 response - MalformedQueryString. The query string contains a syntax error or resource not found.

  • ServiceQuotaExceededException –

    402 response - You attempted to create more resources than the service allows based on service quotas.

  • ThrottlingException –

    429 response - LimitExceededException or TooManyRequestsException.

  • ValidationException –

    400 response - Multiple causes. For example, you might have a malformed query string and input parameter might be out of range, or you might have used parameters together incorrectly.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_route53_recovery_control_config/_services/route53_recovery_control_config.py
def create_routing_control(
    self,
    *,
    config_overrides: Optional[Route53RecoveryControlConfigClientConfig] = None,
    client_token: Optional[
        "capo_route53_recovery_control_config.types.__string_min1_max64_pattern_s.__stringMin1Max64PatternS"
    ] = None,
    cluster_arn: Optional[
        "capo_route53_recovery_control_config.types.__string_min1_max256_pattern_a_za_z09.__stringMin1Max256PatternAZaZ09"
    ] = None,
    control_panel_arn: Optional[
        "capo_route53_recovery_control_config.types.__string_min1_max256_pattern_a_za_z09.__stringMin1Max256PatternAZaZ09"
    ] = None,
    routing_control_name: Optional[
        "capo_route53_recovery_control_config.types.__string_min1_max64_pattern_s.__stringMin1Max64PatternS"
    ] = None,
) -> "capo_route53_recovery_control_config.types.create_routing_control_response.CreateRoutingControlResponse":
    """<p>Creates a new routing control.</p> <p>A routing control has one of two states: ON and OFF. You can map the routing control state to the state of an Amazon Route 53 health check, which can be used to control traffic routing.</p> <p>To get or update the routing control state, see the Recovery Cluster (data plane) API actions for Amazon Route 53 Application Recovery Controller.</p>

    Args:
        client_token: <p>A unique, case-sensitive string of up to 64 ASCII characters. To make an idempotent API request with an action, specify a client token in the request.</p>
        cluster_arn: <p>The Amazon Resource Name (ARN) of the cluster that includes the routing control.</p>
        control_panel_arn: <p>The Amazon Resource Name (ARN) of the control panel that includes the routing control.</p>
        routing_control_name: <p>The name of the routing control.</p>

    Raises:
        capo_route53_recovery_control_config.errors.access_denied_exception.AccessDeniedException: <p>403 response - You do not have sufficient access to perform this action.</p>
        capo_route53_recovery_control_config.errors.conflict_exception.ConflictException: <p>409 response - ConflictException. You might be using a predefined variable.</p>
        capo_route53_recovery_control_config.errors.internal_server_exception.InternalServerException: <p>500 response - InternalServiceError. Temporary service error. Retry the request.</p>
        capo_route53_recovery_control_config.errors.resource_not_found_exception.ResourceNotFoundException: <p>404 response - MalformedQueryString. The query string contains a syntax error or resource not found.</p>
        capo_route53_recovery_control_config.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>402 response - You attempted to create more resources than the service allows based on service quotas.</p>
        capo_route53_recovery_control_config.errors.throttling_exception.ThrottlingException: <p>429 response - LimitExceededException or TooManyRequestsException.</p>
        capo_route53_recovery_control_config.errors.validation_exception.ValidationException: <p>400 response - Multiple causes. For example, you might have a malformed query string and input parameter might be out of range, or you might have used parameters together incorrectly.</p>
        capo_route53_recovery_control_config.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_route53_recovery_control_config.types.create_routing_control_request.CreateRoutingControlRequest]",
    ) -> OperationResponse[
        "capo_route53_recovery_control_config.types.create_routing_control_response.CreateRoutingControlResponse"
    ]:
        import capo_route53_recovery_control_config._operations.route53_recovery_control_config.create_routing_control

        output, http_response = (
            capo_route53_recovery_control_config._operations.route53_recovery_control_config.create_routing_control.create_routing_control(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRoutingControl")
    )
    input_: capo_route53_recovery_control_config.types.create_routing_control_request.CreateRoutingControlRequest = {}
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if cluster_arn is not None:
        input_["cluster_arn"] = cluster_arn
    if control_panel_arn is not None:
        input_["control_panel_arn"] = control_panel_arn
    if routing_control_name is not None:
        input_["routing_control_name"] = routing_control_name

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