As AWS grows, lots of new users are discovering that costs can get out of control very quickly. When you first begin using AWS, what you spend at first is so low compared to in-house enterprise computing that people often don’t pay much attention, at least in the early days. That can lead to sloppy cost management and, after a year or so, renewed financial pressure to reduce costs — even though AWS remains remarkably cost-effective compared to any alternative. Your finance people forget what you were spending a year ago and want to know what you’ve done to cut AWS costs. It’s a simple case of, “What have you done for me lately?”
This post is a pastiche of tips and techniques I’ve used successfully to reduce a client’s AWS expenditures by 65% in June, 2016 over their January, 2016 bill. You can do it, too — and without the extra cost and overhead of an AWS billing management system. It just requires a little rigor in the way you do things.
First things first. Make sure that you set up an S3 bucket to receive AWS billing info in the Billing and Cost Management Preferences. As you can see in the screenshot below, this client collects all data. However, the data I’ve found most useful is the cost allocation data (highlighted in green in the screenshot).
Using the cost allocation data, you can easily produce Excel pivot tables and pivot charts that allow you to precisely allocate costs by AWS service and by your custom tags. See examples in the next two screen shots.
Tagging AWS resources is crucial to managing costs and reporting. If you take only one suggestion from this post, it’s that you need a “tagging architecture” starting the day you launch your first instance. You need to apply tags consistently to every asset, every time. All AWS interactions must apply tags consistently: scripts, applications that create resources and in the AWS console.
Did you know that while you can specify tags for EC2 instances at launch in the console, EBS volumes created for that instance inherit none of those tags? By the end of the month, a major expenditure might not be easily allocated or reported as you’d wish. The AWS Tag Editor can help you find and tag those volumes. Many of the PowerShell scripts I’ve written using the AWS API assign tags when managing assets.
Here’s a smart, but controversial suggestion: fewer tags are better. I have a client that uses exactly one tag key to identify assets. You might be thinking that you could never get by with just one tag for more complex deployments but I’d argue you are wrong.
Here’s a list of some other tips that have worked for me:
- It may be obvious, but stop EC2 instances that aren’t being used. A small, low-cost (t2.micro) “control” instance running cron or PowerShell scripts is a low-cost way to have an in-VPC “command center” for managing running assets if you aren’t auto-scaling
- While you aren’t paying for EC2 instances that aren’t running, you are paying for EBS volumes that support that instance. In Windows especially, people tend to over-allocate EBS volumes and that can really add up fast. Sizing EBS volumes is a bit of a black art, but getting it right can mean big savings. If you have over-allocated EBS volumes, make the effort to reduce EBS volume sizes immediately
- Snapshots add up fast. I am a big fan of using AMIs as Windows Server instance backups. I used to keep a number of back-level AMIs. Now, I recommend keeping just the one you launched the instance from
- Spend time in the Cost Explorer every day. You can use its predictive capabilities to know where you are going to end up for the month very early in the month
- If you use the cost allocation .csv data file, Excel’s “filter” feature can be used to quickly find items without your custom tags
I hope this helps you think about how you can better manage your AWS and EC2 expenditures. If you want to know more about my approach to this area, feel free to contact me.
Leave a Reply