I have a lambda in Python that I want to mock using the moto
framework. When I use the mock_lambda()
context manager (ie: with mock_lambda(): #do stuff
), I'm still getting an error like "error running docker: Error while fetching server API version: HTTPSConnectionPool(host='<host>', port=<port>): Max retries exceeded with url: /version (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at <location>>: Failed to establish a new connection: [WinError <error code>] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))"
. Is there a way to run aws lambdas in a mocked AWS environment with fake credentials and IAM roles without having to spin up a local docker daemon? How would I be able to ensure that this type of unit test works in github actions? If lambda absolutely requires docker daemon to be spun up, are there any other good frameworks besides moto that don't require spinning up docker daemon?
Asked
Active
Viewed 131 times
0

karkir subu
- 33
- 5