Lambda calling a external HTTP endpoint #8509
-
I am running a Moto Server
and invoking a Lambda function,
The invoked Lambda tries to make a call to an external HTTP endpoint, whose response in this case is mocked. However, Lambda is not getting the correct mocked response. I suspect something to do with the hostname in the mocked response 🤔 I am using the The mocked response
However, I get 👇
Any suggestions? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@bblommers tagging with a hope that something similar is known to you |
Beta Was this translation helpful? Give feedback.
-
Hi, I think this happens because moto runs your lambda function inside a docker container which means the Lines 1048 to 1058 in 8007aef Let me know if that helped or not:) |
Beta Was this translation helpful? Give feedback.
Hi, I think this happens because moto runs your lambda function inside a docker container which means the
responses.activate
is not applied because your lambda code runs in a different environment. You could try to provide a separate http server for the lambda to call and mock responses that way.moto/moto/awslambda/models.py
Lines 1048 to 1058 in 8007aef
Let me know if that helped or not:)