I'm looking for the cheapest option to host a Flask API on AWS, specifically avoiding AWS Lambda. I've considered EC2 and Elastic Beanstalk, but I'm curious about other options as well. Any recommendations?
4 Answers
Have you thought about using the cheapest spot instance available? It can definitely save costs compared to other services, although you have to manage the instance yourself.
A single EC2 instance, something like t4g.micro or t3a.micro, might be a solid choice if you're looking for something basic and cheap. Just make sure your traffic demands are manageable with that setup.
If you're avoiding Lambda, you might want to check out AWS Lightsail. It's often a good option for simpler applications without the complexity of Elastic Beanstalk.
If scalability is a concern, ECS with Fargate might be worth considering, especially with spot instances for cost savings. Just be aware it's a bit pricier than standard EC2 if you don't leverage spot pricing effectively.

I agree, Fargate is a good option but can get expensive if you're not careful with instance selection.