flask app with jinja template on serverless (lambda)

0

hi, i've already developed a flask app on my local and am studying aws services for a month and decided to use serverless(lambda) for deploying my app. but i can't decide how to deploy my app. 1- if i use aws sam to deploy my app like in this course: https://www.udemy.com/course/ultimate-guide-to-deploying-flask-to-aws/learn/lecture/27049320#overview i am not sure how will use jinja in my front end or can i use jinja? 2- on the other hand if i trace this coursera course https://www.coursera.org/learn/building-modern-python-applications-on-aws/home/week/3 can i use jinja again? which one is better(for pricing and managing) and for later development(like codepipeline, debug, team works... etc.)? thanks for answers

preguntada hace un año725 visualizaciones
1 Respuesta
1

Hi,

If you want to run flask on serverless there are some options;

  • Typically dockerize your app and run lambda as container. This option can be tried with https://github.com/awslabs/aws-lambda-web-adapter. Zip or containerize the app and that adapter allows you to run them in lambdas.
  • use ECS Fargate (considered serverless).

Both would probably benefit in pushing images to ECR, which then can be used as trigger for a code pipeline, faily well documented pattern.

In terms of comparing Fargate and lambda, it will also depend on traffic as lambda may fit a pay as you go price where traffic is not high and stable.

Fargate in the other hand is more suitable for stable traffic.

In regards to costs still depends. In most cases lambda is cheaper as Fargate does not really scale to zero, but if traffic is intense and massive, a container may be more suited.

Hope it helps

profile picture
EXPERTO
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas