-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple lambdas not communicating locally in sam local start-api #2059
Comments
Were you able to setup |
Yes I set that up, but same behaviour, the first lambda is called locally, but it calls the second lambda of the AWS cloud. |
@blmayer can you post your |
Here's my template.yaml.
|
Anything? |
@blmayer Hi. Did you find any workaround for this? |
I'm wondering this same thing. It seems there should be an option to test all the invoked lambdas locally. Anything new on this? |
I'm also working with similar problem. My problem is how to test this locally. I've started I get this error message:
In my ApiGW lambda i tried to initialize the Lambda service like this: |
I am having the same issue, and news? EDIT: I actually could solve it on linux by running:
and in my python file:
The 172.17.0.1 ip comes from Unfortunately I still have not a deep understanding on how this solved my issue. |
I have a CDK application where I have an API GW with a lambda function which internally invokes another lambda function. When I try to start everything up locally. I get Need help. |
Description
First, invocations done by the go-lambda-sdk using the
lambda.invoke()
function go to deployed AWS lambda instead of the local ones created bysam local start-api
.Second, only lambdas that receives events are being actually mounted on the local container for testing, I think this is not the desired behaviour. I expected my local test environment call other lambdas that are also local.
Steps to reproduce
Create a template.yml with 2 lambdas: one receives the event from the api, the other is just defined on the file. In the code of the first lambda use the sdk to call the second lambda:
lambda1 code:
This is a Golang example, I haven't tried with other languages. The second lambda just needs to receive and return some JSON:
lambda2 code:
Then build and start the local API, the request from the first lambda never hits the second lambda.
Observed result
Addressing the mounting issue, this is what I get:
And this is when I put an API event on the two lambdas:
EDIT: I chaned the token text, the real name of my lambdas and the path of lambdas' code to not show the real one.
Expected result
I expect that the lambdas on my local environment invoke other lambdas in my environment instead of the deployed ones.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Thanks a lot for this yet great tool!
The text was updated successfully, but these errors were encountered: