moto icon indicating copy to clipboard operation
moto copied to clipboard

Feature Request: Simple Backend for Lambda

Open aaronclong opened this issue 3 years ago • 1 comments

I am wonder if the maintainers would be open to creating a simple backend for Lambda? Often, I need to mock invoking Lambda, but I don't need an instance running. It is simple glue code that I don't need test end to end. I just want to assure that I am calling boto3 correctly. Likewise, Docker sometimes is blocked, limited, or general unusable in certain CI environments.

The batch has a simple_backend that I am wonder if could be copied/adapted to a Lambda backend.

https://github.com/spulec/moto/issues/3997

aaronclong avatar Nov 29 '22 14:11 aaronclong

Hi @aaronclong, that sounds like a reasonable feature. The response would have to be hardcoded of course, both the Lambda-result and the resulting logs. Do you have any preference or ideas on what that could look like?

bblommers avatar Nov 29 '22 21:11 bblommers

@bblommers I am sorry for the late response, a bit behind because of the holidays. I don't have any strong preference. TBH, this library is great, and I rarely have to look under the covers. So, I am not terribly knowledgeable about how to implement this.

My only preference would be allowing us to setup a fake lambda easy for No-op runs, and allow us to simulate success/failures.

I know that is incredibly vague. Let me know if there is anything I can do to help.

aaronclong avatar Dec 06 '22 21:12 aaronclong

No problem @aaronclong. Having full flexibility in configuring how the responses look like would be great. Other people have requested this for other operations, so ideally we find a solution that works for every service. But I don't know yet how that's going to look like.

bblommers avatar Dec 08 '22 00:12 bblommers

@aaronclong is this something that you still need? I may have time over next few weeks to implement

rafcio19 avatar Oct 27 '23 06:10 rafcio19

I actually switched jobs and using a different stack. However, I do believe there is value in implementing this.

aaronclong avatar Oct 31 '23 19:10 aaronclong