News for hackers. Stuff that matters.
Re:Running Containers on AWS Lambda by scottydelta on Wednesday April 27, 2022 @01:33PM (#31183109)
Is it possible to host an app like Django inside container on lambda? This could help the Django/postgres apps to scale horizontally easily.
Re:Running Containers on AWS Lambda by throwaway2016a on Wednesday April 27, 2022 @02:27PM (#31183855)
Not sure about Django but on the Node.js side there are Express.js compatible libraries that let you write your app like you would Express but it's exposed via Lambda and API gateway. Good chance Python has something similar. Biggest difference is you're not dealing with HTTP (directly) but it can be abstracted to -- from a framework perspective -- act like HTTP.
Re:Running Containers on AWS Lambda by dsanchez97 on Wednesday April 27, 2022 @02:41PM (#31184052)
I am actually working on a python library that works like you described at https://cdevframework.io! The goal is the provided a developer experience like Django that then deploys onto Serverless Infrastructure. It is a long way from that goal, but one day it will get there!
Re:Running Containers on AWS Lambda by adamgordonbell on Wednesday April 27, 2022 @01:46PM (#31183326)
Yes, but is the startup time of Django an issue? Besides that you'd have to return your data in the shape that the API gateway expects from lambdas.

Returning a 500 would look something like this:

    {
     "statusCode" : 500,
      "headers" : {
        "content-type": "text/plain; charset=utf-8"
     },
     "body" : "Some error fetching the content"
   }
Re:Running Containers on AWS Lambda by manfre on Wednesday April 27, 2022 @04:30PM (#31185356)
Yes, it's possible to wrap any asgi app to run in a lambda. Check out Mangum https://github.com/jordaneremieff/mangum
Re:Running Containers on AWS Lambda by gatvol on Wednesday April 27, 2022 @03:17PM (#31184509)
Yes it absolutely is possible. I have been considering doing this in combination with PG Aurora v2
Re:Running Containers on AWS Lambda by ralusek on Wednesday April 27, 2022 @09:38PM (#31187904)
Is Aurora v2 still inaccessible from outside the VPC? The fact that I have to set up some kind of proxy EC2 in order to view the database from my machine is a non-starter for me.
Re:Running Containers on AWS Lambda by zokier on Wednesday April 27, 2022 @04:23PM (#31185273)
You can run any wsgi application in lambda with libraries like https://pypi.org/project/apig-wsgi/
Re:Running Containers on AWS Lambda by klohto on Wednesday April 27, 2022 @03:10PM (#31184420)
Not Django, but AWS has a product focusing on this - Chalice https://github.com/aws/chalice
Re:Running Containers on AWS Lambda by alksjdalkj on Wednesday April 27, 2022 @06:08PM (#31186445)
Pretty sure Zappa does this: https://github.com/zappa/Zappa