-
Notifications
You must be signed in to change notification settings - Fork 380
Description
I've set up a lambda with CDK by referring to the repository structure used by rnag/rust.aws-cdk-lambda/cdk-examples/rust-standalone, whilst matching this repo's up-to-date dependencies.
I want to do local testing (run this lambda as a server on localhost and make HTTP GET requests to it), so I've tried running this:
$ sam local start-lambda --port 8011 --template ./cdk.out/RustStandaloneStack.template.json
Starting the Local Lambda Service. You can now invoke your Lambda Functions defined in your template through the endpoint.
2023-01-23 11:08:56 * Running on http://127.0.0.1:3000/ (Press CTRL+C to quit)The server successfully starts up, but I can't figure out what sort of request to send it. It just responds with a 404 no matter what path or headers I specify to it with my GET requests.
By comparison, one-off invocations work just fine:
# ./tests/sample.json is an event matching the same format of the one seen in this issue comment:
# https://github.com/awslabs/aws-lambda-rust-runtime/issues/365#issue-1054795934
$ sam local invoke MyRustLambda --event ./tests/sample.json --template ./cdk.out/RustStandaloneStack.template.jsonRequesting using the exact same path and headers specified in my ./tests/sample.json file, I am met with a 404 response.
This feels like an underdocumented area in the SAM/CDK/Lambda docs so any pointers would be greatly appreciated.