Fallback
The fallback configuration for a route to an inference target. Defines an ordered list of fallback targets to try when a request to the route's target fails, and the conditions that trigger a fallback. A fallback can occur only before the gateway sends the first byte of the response to the caller. After a streaming response starts, the gateway doesn't fall back.
Contents
- targetFallback
-
The ordered list of fallback targets. The gateway tries each target in order until a response doesn't match that target's triggers, and returns that response to the caller. If every target fails, the gateway returns the last response. You can specify up to two fallback targets. Each combination of target and model, including the route's target, can appear only once.
Type: Array of FallbackTarget objects
Array Members: Minimum number of 1 item. Maximum number of 2 items.
Required: Yes
- circuitBreaker
-
Specifies whether the gateway temporarily stops sending your requests to a failing target. The circuit breaker tracks each combination of target and model separately. With the circuit breaker enabled, the gateway skips one or more targets and models that fail repeatedly, and your requests go to the next target in the chain. The gateway always tries the last remaining target in the chain. The gateway enables the circuit breaker by default.
Type: CircuitBreakerConfiguration object
Required: No
- firstByteTimeoutMilliseconds
-
The maximum time, in milliseconds, from sending the request to the route's target until the first byte of the response body arrives. If the time expires, the gateway abandons the request and treats it as a
FIRST_BYTE_TIMEOUTerror. If you don't specify a value, no timeout is enforced.Type: Integer
Valid Range: Minimum value of 50. Maximum value of 900000.
Required: No
- triggerOn
-
The status codes and errors from the route's target that cause the gateway to send the request to the first fallback target. If you omit
triggerOn, the gateway falls back on5XXstatus codes and on theCONNECTION_ERROR,FIRST_BYTE_TIMEOUT, andUNROUTABLEerrors. If you specifytriggerOn, only the status codes and errors that you list trigger a fallback.Type: FallbackTriggers object
Required: No
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: