By using AWS re:Post, you agree to the AWS re:Post Terms of Use

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

1 Answer
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
EXPERT
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions