Open sevetseh28 opened 1 month ago
BTW the endpoint im calling is using an AWS Integration (for example, to start execution of a State machine). I guess this might be why, as it's trying to invoke a lambda function for this integration. Is there any way I can mock it?
Can you provide a sample project for us to reproduce this issue? The bounds of what we support with sam local
is limited, and we may not support your use case (ie. APIGW integration with a state machine), but we'll be able to help further with a project.
hey @lucashuy thanks for your reply. I ended up changing my integration type to Lambda proxy integration for more flexibility and endpoint customisation. I was initially using Step Functions integration but sam doesn't seem to support it, I read the source code here. I thought that the SAM tool would mimic the Integration through a Lambda function locally
Our support for Lambda invocations locally is limited to directly invoking the Lambda (through sam local invoke
and sam local start-lambda
), and with the API Gateway Lambda integrations (using sam local start-api
).
Unfortunately we don't support the local invocations of Lambda through other integration means with API Gateway.
The AWS Step Functions team created a tool to use together with SAM CLI to help test Step Functions locally and requires a little bit of setup to use. This can be an alternative to using SAM CLI as an "all-in-one" solution. https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local-lambda.html
I'm going to leave this issue open for now as the only item for our team to take from this issue is that we probably should fix that method that returns a ValueError
, to return our own error instead of reusing the built-in exception.
Hi everyone. I'm running my API Gateway locally with:
sam local start-api --hook-name terraform --disable-authorizer
The API Gateway starts without issues ,but when hitting any endpoint I get the following:
I ran the above with and without the authoriser, but I've also tried running the authoriser individually with:
sam local invoke ModuleIdeApiAwsLambdaFunctionAuthorizerFunction836CD508 --hook-name terraform --skip-prepare-infra --event authoriser-event.json
and it works well when running the Lambda function alone. Any ideas what could be wrong?
Thank you!