AWS S3 Usage Limit : How to reduce usage? - django

I have nearly reached my AWS S3 usage limit for the month, after having started it just a couple of weeks ago, and I'm trying to understand why. I've never used AWS before, and I'm a newb in general. I literally have 3 jpegs in storage, nothing else.
Is usage solely determined by hours? I read that hours are instances where the storage is made available. Right now I have the Django project hosted on Heroku with media on AWS. I am very much still in dev mode, and only need AWS when testing project on Heroku, but most of the time I'm in local environment. Given that, I am confused how my usage limit could be nearly reached within a couple of weeks. Any guidance is appreciated.
Update: I was mistaken. The account number listed in the warning email is the same used for my AWS S3, but it is referring instead to RDS. When I see all products under the account it shows S3 (which is well below the limit) and RDS (which is nearly at the limit). The quandary now though is that I never intended to create an RDS instance. And, when I click on "databases" under RDS, it actually says I don't have any RDS instances. So I don't have RDS yet I do because I am soon to be charged for going over the limit. I've never used AWS before, and I'm a newb in general. I initiated S3, the only product I intended to have under the account, for the sole purpose of serving media files not served by Heroku.

In the AWS management console:
Click your username (in the top-right, to the left of the Region name)
Select My Billing Dashboard
Click Bill Details in the top-right
This will give you a breakdown of costs by service and region.
It is possible that your Amazon RDS instance is running in a different region, so find the region where the RDS costs are occurring and:
Go to Amazon RDS in the management console
Change the Region in the top-right to the one that was shown in the billing console
Delete the database (if you are sure you aren't using it)

Related

I have a lot of AWS resources in the tag editor

I created my AWS account and got 12 months free plan. Then I went to the teg editor to check all my running services and there were 165 unnecessary running services. Maybe someone had the same problem? Is this ok and I don't have to pay for it?)
Screenshot
Just because they exist, does not mean they are running.
Those look like to be the default VPCs that are created by AWS in every region by default for every AWS account.
If you didn't create them, don't worry - you aren't being charged for them.
AWS does not provide any default resources that charge you money.

AWS is charging me but the Billing Console doesn't show what the issue is

AWS is charging me but the cost reports aren't showing enough detail to figure out why. I think it might be one EC2 instance I created for the tutorial but I can't figure out how to delete it. Can you help?
I signed up for Amazon free tier and I'm doing the tutorial on https://aws.amazon.com/getting-started/projects/build-modern-app-fargate-lambda-dynamodb-python/?e=gs&p=gsrc
It says on the first page "Many of the services used are included in the AWS Free Tier. For those that are not, the sample application will cost, in total, less than $1/day." So then I finished the first two modules of that tutorial and quit for the day -- I didn't shut down any services (cause the tutorial didn't tell me to) but today I got an email saying I've exceeded my $5 AWS threshold in only e days! The email has a link to a Cost Report that says it's spending $2.16 per day, but it won't tell me what!
I've gone through all the cost explorer reports and they confirm I'm spending money on EC2 but I can't find why. Can you help?
Here's a screenshot of the "Billing Management Console" -- says I spent that money on "EC2". But then when I drilled down into EC2 it wouldn't tell me exactly what.
So I clicked on the AWS Cost Management report and it says I'm spending $2.16 a day but it won't give any more granularity that that because all the advanced reports are monthly and don't yet show the last three days. (Apparently it lets you opt-in to daily/hourly reports but it says it charges a fee for that too so I didn't). So I don't know what specifically is charging.
So I clicked on the EC2 Dashboard. It said I'm using one volumne, 2 elastic ip addresses, and 4 security groups. I figured out how to delete the volume but I can't figure out how to delete the IP address or the security group. Are those charging me money? How do I delete them?
I went to the EC2 Instances and there is one "Volume" in use (basically a docker container created for the tutorial) so I deleted that, but that was well below what the Free Tier provides, so was that the source of my charges? Then I went to the Instances and it says there is one instance so I deleted that too. But it still says I have two IP addresses and comments below say I'm being charged for that.
How can I delete this IP addresses? There is no delete button.
How can I be 100% sure everything is deleted and I'm not getting any more charges?
Turns out the answer was actually a NAT Gateway VPN. That doesn't show up on the billing report screenshots above, but I eventually found it mentioned on the billing and then shut it off.
Unassigned ElasticIP will cost you money.
You delete ElasticIPs by Releasing them.
Security groups does not cost money. In general, for advanced users it is better to create all resources with CloudFormation stack so they can be all cleaned by deleting the stack.
If you have an Elastic IP assigned, and it's not in use, AWS charges you for it, if it's actually assigned to an EC2 instance and used, it's free. (To discourage people from hoarding Elastic IPs.)
When you're in the EC2 web console, click 'Running Instances'. What do you see? How many instances? How many stopped? How many running?
I don't think the security groups can be deleted, and I don't think AWS charges for them.

How to ensure AWS Elastic Beanstalk is free

I am wanting to deploy a Django webapp with a PostgreSQL database to AWS Elastic Beanstalk using this tutorial, but I am so confused about pricing. It says it uses services in the AWS Free Tier, but those seem to be limited to a certain number of hours a month, so how do I make sure I don't go above that threshold? And how do I make sure I'm only using free services? They even require a card on file, so it seems really hard to make sure I don't get charged.
You can do the following configuration to make sure you use AWS Elastic Beankstalk for one year free.
Use only Micro instances for the WebServer and RDS instance.
Limit the scaling of the WebServer maximum to 1 or use Standalone deployment without autoscaling.
When selecting storage, use less than 30GB for EBS and don't enable Provision Throughput.
Apart from these, there are usage base costs for Network, EBS IOPS & etc which includes a free quota and the cost is not considerable when it comes to light use cases.
The AWS Free Tier allows AWS accounts to use a certain amount of services for no charge. Any usage beyond the free tier limits will result in a charge on your credit card.
The Free Tier is intended to provide a trial of AWS services. It is not intended for production use, nor is there any guaranteed way to stay within the free limits. It is up to you to monitor your usage.
There is no such thing as a totally free AWS account.
I have found "Cost Management Preferences" -> "Receive Free Tier Usage Alerts" setting in Billing preferences menu. Hopefully this will be enough for a small personal projects with low usage. I would guess it is not enough for large projects since this is only a notification.
In short, you can absolutely make sure that your app stays free, just not from within the AWS interface. You'll have to use your own usage monitoring to ensure you stay within the free limits as others state.
As Ashan said, this is a pretty silly approach since fees are nominal and the alternative is a loss of service, however, AWS does offer APIs to help you do this through CloudWatch.
CloudWatch exposes pretty much all of the billable metrics on a service-by-service basis, for example here are the metrics for EC2, and here are the metrics for S3. After starting your services through beanstalk, just look up all the services you're using via the billing page of the AWS console, look up the CloudWatch APIs for each, then check them.
At least for EC2, there are even customizable alarms and actions, including shutting down the instance. See the Monitoring tab at the bottom of the EC2 console. Not sure, but you might have to manually throw status updates to their status system for some of the other metrics. If so, it's not that difficult. You'd set up an access key for some IAM identity so you can check CloudWatch stuff from command line. Then, you'd write a watchdog script to run on that instance using AWSCLI to regularly ping CloudWatch and call your shutdown code or modify your status if you're over some percentage of your quota.

Turn off Amazon EC2/RDS

I am in the process of learning more about Amazon AWS. I want to turn off my Amazon Elastic Beanstalk EC2/RDS services. I have selected the minimum service entries, but I am still racking up small service charges. How do I do this?
have selected the minimum service entries, but I am still racking up
small service charges.
It isn't clear what you are saying with that sentence. Do you mean to say that you are within the limits of the free tier and yet you are still getting charged?
If you want to just "turn off" your EC2 and RDS instances then delete/terminate them. Afterwards look at the EBS snapshots and volumes, and the RDS snapshots and delete any of those that are still there. That will most likely stop the charges.
If you want to know exactly what you are being charged for so that you can zero in on the culprit you can enable detailed billing.
AWS has pretty good documentation on setting up and terminating instances. Here's a page with instructions on how to terminate an environment using the AWS Management Console:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.terminating.html.

AWS: How to disable all services?

I was dorking around with AWS (and related services), hoping that I could stay in the Free Tier, like I do when I'm exploring Google App Engine.
A few days ago, I get a letter from Amazon that they've charged me $33 or so for my 2 days of exploration.
This has got to end, but I forget what services I've enabled. Ideally, I'd just disable the AWS account entirely, as without a free sandbox there's no way I'm going to be using their service. Is there a global off button, or do I have to stumble around to turn all their services off individually? Or do I have to delete my CC information and just create a new Amazon account altogether?
You can close your entire account in AWS Billing: https://console.aws.amazon.com/billing/home?#/account
Or if you just want to disable your "Free-Tier" services that has charges, view them here:
https://console.aws.amazon.com/billing/home#/freetier
Then open your EC2 dashboard - and cancel those services:
https://us-west-2.console.aws.amazon.com/ec2
For example:
Stop running instances, delete volumes, remove elastic IPs, etc.
Otherwise, I recommend sending an email to webservices#amazon.com from the email you used to signup with their service.
I had an RDS running and I couldn't figure out how to cancel just that service
Here's how to do it:
Go to billing services
https://console.aws.amazon.com/billing/home?region=us-west-2#/
Click "Bill Details"
Inspect it
You'll find NAME OF SERVICE + ITS LOCATION. This is the information you need.
https://console.aws.amazon.com/rds/home?region=us-east-1
Go to topright of page. Select the correct server location
The rest is straightforward from here
I was also frustrated (by being charged on the free tier without any info/warning in prior) and found a simple and elegant solution to turn off all AWS services. You delete your account and forget about these fraudulent (to be honest) AWS services.
Here is the link:
https://console.aws.amazon.com/billing/home?#/account
Here is the section:
I know this is a somehow an old question, but I would like to add a new answer because I think AWS has changed a lot since this was asked. I have stumbled on a similar situation as the OP and I found out that there are 3 possible ways to achieve this:
To have a single turn-off-everything button, but I'm not sure if this exists.
Overkill, go through the services and check them one by one and shutdown/delete any instances or running services.
To find out the actual source of leaking (cost occurring services) by viewing what is posting charges on your account and then turn off these services one by one. This can be done by visiting:
your AWS account >> My Billing Dashboard
Find your account username and open the drop down menu:
You can check what services are incurring fees.
Percentage table:
I followed the services by searching for their name on AWS console, if I couldn't find it I'd Google how to do so and then turned them off one by one.
In my case, there was no charge towards my bank even thought billing showed I have some balance, I think it's because I was using the free tier, maybe?
I just hit my free tier limit. I terminated my ec2 instance, deleted my storage volume and even removed my security group and key pair so I have nothing now. Hopefully no charge :P
Always make sure you select the right region. I once had 2 instances running and didnt realize it.
Today I finally discovered a global view to detect all the active services, you still have to disable every service manually but at least you don't have to switch all the regions to understand where you have active services.