I know you can upload a docker container to an AWS lambda function. Is there a way to map two docker containers to the same lambda function? So that one executes after the other. This would allow some local communication through the temp disk.
I know you can upload a docker container to an AWS lambda function. Is there a way to map two docker containers to the same lambda function? So that one executes after the other. This would allow some local communication through the temp disk.
Unfortunately a Lambda function may only be tied to a single Docker image.
There's a couple ways you could go about achieving this desired functionality:
If you don't need two separate lambda functions, you can break your project into distinct files while still having everything wrapped in a single container. It might look something like this:
project_name
|
--- Dockerfile
|
--- src
|
--- lambda_function.py
|
--- file1.py
|
--- file2.py
where lambda_function.py contains your handler which calls methods from file1.py and file2.py.
If you do need two distinct Lambdas, you have a couple options. First I would suggest setting up an API Gateway in between lambda 1 and lambda 2. This way, lambda 1 can make a curl request against the API, which will call the second lambda on your behalf.
Another option would be Step Functions. It provides a nice UI to set up how your Lambdas will interact with each other. The downside of Step Functions is that it quickly becomes unmanageable as you add more lambdas to the mix.