Rust AxumでAWS Lambda Web Adapterが動作しなくなった

.route_layer(from_fn_with_state(
app_state.clone(),
authentication_middleware::authentication_middleware,
))

~~

let (router, api) = OpenApiRouter::with_openapi(ApiDoc::openapi())
.nest("/api/v1", openapi_router)
.split_for_parts();

認証のlayerを追加する部分とAPIをnestしている部分が原因だった。


https://github.com/awslabs/aws-lambda-web-adapter/tree/main?tab=readme-ov-file#configurations

に記載があるように、開発初期段階のためdefaultのGET "/"に対してreadiness checkが通っていたが開発が進むにつれてGET "/"へのreadiness checkが通らなくなり問題が露見した。

Related Articles