Skip to content

update_alias_routing

update_alias_routing(
    app_name: AppName,
    environment_name: EnvironmentName,
    alias_name: AliasName,
    routing_config: RoutingConfig,
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    gradual_rollout_config: Optional[GradualRolloutConfig] = None,
) -> UpdateAliasRoutingResponse

Updates the traffic routing for an alias of an environment.

Parameters:

  • app_name (AppName) –

    The name of the app.

  • environment_name (EnvironmentName) –

    The name of the environment.

  • alias_name (AliasName) –

    The name of the alias.

  • routing_config (RoutingConfig) –

    The traffic routing configuration to apply to the alias.

  • gradual_rollout_config (Optional[GradualRolloutConfig], default: None ) –

    The gradual rollout settings to apply to the alias.

Raises:

Source code in docs_src/capo_amplifygen3/_services/amplify_gen3.py
def update_alias_routing(
    self,
    app_name: "capo_amplifygen3.types.app_name.AppName",
    environment_name: "capo_amplifygen3.types.environment_name.EnvironmentName",
    alias_name: "capo_amplifygen3.types.alias_name.AliasName",
    routing_config: "capo_amplifygen3.types.routing_config.RoutingConfig",
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    gradual_rollout_config: Optional[
        "capo_amplifygen3.types.gradual_rollout_config.GradualRolloutConfig"
    ] = None,
) -> "capo_amplifygen3.types.update_alias_routing_response.UpdateAliasRoutingResponse":
    """<p>Updates the traffic routing for an alias of an environment.</p>

    Args:
        app_name: <p>The name of the app.</p>
        environment_name: <p>The name of the environment.</p>
        alias_name: <p>The name of the alias.</p>
        routing_config: <p>The traffic routing configuration to apply to the alias.</p>
        gradual_rollout_config: <p>The gradual rollout settings to apply to the alias.</p>

    Raises:
        capo_amplifygen3.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_amplifygen3.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_amplifygen3.errors.internal_server_exception.InternalServerException: <p>An internal error occurred. Retry the request.</p>
        capo_amplifygen3.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_amplifygen3.errors.throttling_exception.ThrottlingException: <p>The request was denied because the request rate exceeds the allowed limit.</p>
        capo_amplifygen3.errors.validation_exception.ValidationException: <p>The request contains invalid parameters or is otherwise malformed.</p>
        capo_amplifygen3.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amplifygen3.types.update_alias_routing_request.UpdateAliasRoutingRequest]",
    ) -> OperationResponse[
        "capo_amplifygen3.types.update_alias_routing_response.UpdateAliasRoutingResponse"
    ]:
        import capo_amplifygen3._operations.omega.update_alias_routing

        output, http_response = (
            capo_amplifygen3._operations.omega.update_alias_routing.update_alias_routing(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAliasRouting")
    )
    input_: capo_amplifygen3.types.update_alias_routing_request.UpdateAliasRoutingRequest = {
        "app_name": app_name,
        "environment_name": environment_name,
        "alias_name": alias_name,
        "routing_config": routing_config,
    }
    if gradual_rollout_config is not None:
        input_["gradual_rollout_config"] = gradual_rollout_config

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