AWS Free Tier Limitations for EC2 - amazon-web-services

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

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:
EC2 Launch Type: which lets you choose your EC2 instances as the computational node.
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

Related

Are EC2 Windows instances charged per hour or per second?

I am appearing for AWS CCP tomorrow , I thought Windows EC2 instances are billed per hour but this confused me. Can anyone help me understand the difference between Windows Ec2 instance and Windows based Ec2 instance is the question wrong
Amazon EC2 instances running Windows were historically charged per hour.
However, they are now charged per-second.
As written in your screenshot: "Windows based EC2 instances used to follow pay-per-hour pricing earlier."
See: Understand Amazon EC2 instance-hours billing
Another link would be the official documentation for the on-demand EC2 pricing stating:
Pricing is per instance-hour consumed for each instance, from the
time an instance is launched until it is terminated or stopped. Each
partial instance-hour consumed will be billed per-second for Linux,
Windows, Windows with SQL Enterprise, Windows with SQL Standard, and
Windows with SQL Web Instances, and as a full hour for all other
instance types.

How to check unused AWS Running instances

We trying to find the unused(which is not using long time)running AWS instances, can someone please let me know the way to find the unused AWS running instances. Thank you
Thanks
AWS Trusted Advisor automtically checks for Low Utilization Amazon EC2 Instances:
Checks the Amazon Elastic Compute Cloud (Amazon EC2) instances that were running at any time during the last 14 days and alerts you if the daily CPU utilization was 10% or less and network I/O was 5 MB or less on 4 or more days.
It also provides a list of such instances that you can download. If you want to search instances based on your-own custom under utilization criteria, you would have to create your own custom solution for that.

Amazon RDS instances and the new Compute Savings Plans

I have a small single-instance deployment running on an EC2 instance which hosts both a web application and its database (MySQL). I've been looking to separate the deployment out into an EC2 instace for the web app and an RDS cluster for the database, and wanted to take advantage of the new AWS Savings Plans for both if possible.
My questions the are:
AWS Savings Plans seem to only apply to 'pure' compute EC2 instances, not to RDS instances as well. Can someone confirm or disprove this?
If Savings Plans did apply to RDS instances, is there a reason to not use them, and instead just use an Instance Reservation?
Since August 2020, AWS Savings Plans includes:
Amazon EC2
AWS Lambda
AWS Fargate
They do not apply to Amazon RDS db instances. For those, you can continue to use Amazon RDS Reserved Instances.
I want to clarify that even though Savings Plans do not cover RDS instances, they do cover EC2 instances that are part of EMR, ECS and EKS Clusters. Based on this link:
"Both plan types apply to EC2 instances that are a part of Amazon EMR, Amazon EKS, and Amazon ECS clusters. Amazon EKS charges will not be covered by Savings Plans, but the underlying EC2 instances will be. "
Also, Compute Savings Plans also apply to your Fargate and Lambda usage.
We moved to RDS from EC2 instances running self installed MySQL years ago. For me, at has been great. All of the RDS features work flawlessly, point and click, without the mundane work of spinning up, replicating, backing up, and failing over databases. It simply works great. Use reserved instances if you plan on keeping for at least a year. At 30% savings the cost is awash even if you bail on the server after about 9 months and don't use the entire year. Plus you can sell the unused remaining on the marketplace.
Downsides?
You do NOT get command line OS access to the MySQL server. You get an admin login to mySQL. The only way to manage it is through the AWS UI and the mysql client command line or managing client (like MySQL Workbench or Heidi).
You may want to run a mysqldump script on a separate EC2 to dump databases separately/additionally. AWS does SNAPSHOTS which require an entire restore of a sandbox server just to get a single table someone botched up, for example. I go to the MySQLdump files all the time. Never have needed the SNAPSHOT unless I am spinning up a sandbox copy of the entire instance for some reason.
In a nutshell, mySQL on RDS is great.
One other side note. We migrated an app using MySQL5.7 to Aurora MySQL with absolutely zero issues. Complete drop-in replacement (in our case).

AWS Lightsail MySql Database

I have taken a AWS Lightsail Unix Instance for one of my pilot project, I wanted to explore AWS ecosystem and thought this would be a easy playground to start with. The plan I opted was a USD 5 per month, which gives 1 GB Memory, 1 Core Processor, 40 GB SSD Disk and 2 TB Transfer.
After subscribing I created a LAMP instance and a Plesk Instance, assigned static IPs to both instances and setup connections from my PC to transfer files using PuTTY; also setup access to Plesk and phpMyAdmin to start work.
In the first month itself, I am seeing a huge bill of USD 985 for using AWS RDS, details in bill are as below:
Amazon Relational Database Service for MySQL Community Edition
$1.080 per RDS db.r4.xlarge Multi-AZ instance hour (or partial hour) running MySQL
My question is - When I created LAMP, does it create a AWS RDB service automatically, I have hardly used MySql for anything. It seems AWS Lightsail is throwing hidden charges without notifying customers about actuals.
No, creating a LAMP stack on Lightsail does not create an RDS instance on your behalf. With the LAMP stack on Lightsail, the MySQL database is installed on that instance alongside PHP and Apache - there is no charge beyond the $5.00 / month (in your case) as long as you don't go over the data transfer limit.
I can't say why you're getting charged for RDS, but it's not because you fired up Lightsail instances.
Thank you folks!
I tried to go through several docs AWS provides on pricing. There is no indication that AWS RDB services automatically starts on LAMP installation. I wanted to take second opinion before raising a complaint with them. I have opened a case, and they have confirmed to revert the charges, however there is no clarity how AWS RDS service has started. At present I have removed all DB snapshots and backups.

Amazon AWS FreeTier as Dev together with Reserved Instance as Prod [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 days ago.
Improve this question
We would like the following :
Dev Env will reside on AWS free tier account (both EC2 & RDS )
Once Dev env is ready and QA are finished, we will image this instance and open an additional 1 EC2 reserved instance.
Questions :
Can we benefit / use AWS free tier account for DEV and reserved instance for PROD at the same time, meaning we won't pay for Dev (1yr) and Prod we will pay for the 1 instance reserved price ?
If We would like to use PROD with reserved instance and activate autoscale (using on-demand or additional paid reserved instances) is it possible ?
To be honest I don't think it's worth the hassle as you can spin very cheap instances for development purposes. You can even automatically shut them down after office hours and on weekends when nobody is using them.
To address your questions:
It is possible to share an AMI with another account. See Sharing an AMI with Specific AWS Accounts
So once your instance has been approved on the dev account you can create an image, make it available to your prod account only, without making it public, and launch an instance based on that image.
According to AWS documentation it's possible to use auto-scaling with reserved instance benefits:
You can use Auto Scaling or other AWS services to launch the On-Demand instances that use your Reserved Instance benefits. For information about launching On-Demand instances, see Launch Your Instance.
Source: Reserved Instances
Let's look at each element individually...
Dev Env will reside on AWS free tier account (both EC2 & RDS )
The AWS Free Usage Tier provides free access to specific services within specific limits for the first 12 months of an AWS Account. In the case of Amazon EC2:
750 hours of Amazon EC2 Linux t2.micro instance usage (1 GiB of memory and 32-bit and 64-bit platform support) – enough hours to run continuously each month*
750 hours of Amazon EC2 Microsoft Windows Server t2.micro instance usage (1 GiB of memory and 32-bit and 64-bit platform support) – enough hours to run continuously each month*
A t2.micro instance in the USA is 1.3c per hour. So, the benefit gained from one instance (eg Linux) in the free tier is worth $113 (0.013*24*365).
For Amazon RDS, the value is approximately $150 (depending upon the chosen database):
750 hours of Amazon RDS Single-AZ db.t2.micro Instances,for running MySQL, PostgreSQL, MariaDB, Oracle BYOL or SQL Server (running SQL Server Express Edition) – enough hours to run a DB Instance continuously each month*
So, you really need to ask yourself whether doing strange things is really worth saving $263, given that it will be limiting you to micro-sized EC2 and RDS instances. A few hours of your time is presumably worth more than this, so it would be better for you to create infrastructure that is needed to successfully deliver your system rather than trying to focus on how to avoid spending money.
As an example, it is possible that these instance types might be too small for your development work and you will spend more time trying to get it to work (or waiting for it if it is slow), rather than productively spending your time on delivering a successful project.
Once Dev env is ready and QA are finished, we will image this instance and open an additional 1 EC2 reserved instance.
Reserved Instances are a great way to reduce your Amazon EC2 costs. However, you do not want to lock yourself into a particular instance type which might later prove inappropriate. For example, you might purchase a Reserved Instance for a medium instance, but later find that you actually need a large instance. This would mean your Reserved Instance is wasted.
It is much better to run your system for 2-3 months to understand your usage patterns before committing yourself to a Reserved Instance.
If We would like to use PROD with reserved instance and activate autoscale (using on-demand or additional paid reserved instances) is it possible ?
You can certainly use Auto Scaling to add additional instances. These additional instances would be charged at on-demand rates. If you purchase additional Reserved Instances, then you should run those instances all the time since you are already paying for them. There would be no benefit in reducing your number of instances to below the number of Reserved Instances you have purchased.
Bottom line: The cost of a couple of Amazon EC2 instances is not very high. Spend your time producing a great app rather than focussing on how you can reduce your expenditure by a couple of hundred dollars.