1
votes

I am new to AWS so please bear with me as my question might not make sense. BUT I had one ec2 instance running a single flask web application for about 3 months and my bills were in the $0-$0.50 range. However, I started to experiment with docker images, and such, I had these docker images running in their own containers on a separate ec2 instance. So for the month of April, I got charged $35 instead of the usual $0.50, so after a call with AWS they said my ec2 instances went over the limit of 750 hrs of time. So my thought process is I have only one ec2 instance running which in turn has multiple docker containers running serving different applications, could this help keep my costs from ballooning? Or would each docker container count towards the 750 hrs of montly time?

If my question did not make sense, please ask questions to my question :P

1

1 Answers

1
votes

Hello Abhishek Hotti,

I can understand your frustation, I came on AWS while ago by experimenting like you and I can tell you I was billed my first month with more than 300€ due my "missunderstanding" of the AWS services and the Freetier layer.

I can tell you now, that Amazon ECS uses mainly two different approaches to launch containers:

  1. EC2 Launch Type: which lets you choose your EC2 instances as the computational node.
  2. Fargate Launch Type: which is fully managed by AWS. Your containers run without you managing and configuring individual Amazon EC2 instances. That means that despite you doesn't see the EC2 instances they are in the background and you are billed for that.

AWS Source documentation

The issue here seems to be that you are using two EC2 instances. According to the free tier layer in AWS:

750 hours per month of Linux, RHEL, or SLES t2.micro or t3.micro instance dependent on region

Making a fast calculation: each month are 24h * 30 days = 720h. Gf you are using two instances that will be = 1440 hours. That is above of the free tier layer and you are billed in consequence.

If you will be using the Fargate launch type option your bills will contain the use of the Fargate infrastructure that will be located in the background.

I hope this helps