Amazon EC2 & S3 costs - can they be tied to specific instances [closed]
I'd like to start using S3 and EC2 to host some of my company's simpler websites. I would like to be able to identify all of the costs associated with running each site (instance run-time costs + storage + data transfers) so that the costs can be allocated (cross-charged) to business units in my company.
Is it possible to identify all the costs associated with each site in this way if all of the sites are running on separate instances?
Unfortunately, Amazon does not provide any way to obtain the costs associated with a specific EC2 instance. You would have to create a separate AWS account for each business unit.
This may have other benefits for your particular setup. For example, if you ever want to use a different credit card for each business unit, you would need to separate the AWS accounts anyway.
You can share AMI's and EBS snapshots (but not volumes) between accounts.
Matt Simmons asked to see a report - here's our billing report for the start of June. A single Amazon account aggregates all the instances into one report. You can use the "Download Usage Report" links to get XML or CVS data with instance usage at granularity of an hour, but that will just tell you how many instances of a type you were using during that period.
We use Python and the boto library to do a lot of our administrative tasks. You could put different internal users in different security groups, and then use the AWS services to poll how many instances, and what kinds, are running in each security group at any time. This may give you enough data to bill your internal users within a few dollars of their actual usage. The AWS API is well documented, so there is probably a library in your (or your programmer's) favorite language.
Amazon does not provide detail on per instance usage below the account level. All you get is:
Small instances: 9,000 hours
Med CPU instances: 12,000 hours
EBS Usage: 300TB
etc. etc.
You will have to roll your own metering to track this or you will have to set up separate accounts for each site that you are monitoring. I strongly recommend setting up separate accounts - that way you can save the pain of setting up your own metering.
If you do use multiple accounts as some have proposed, make sure you check out Consolidated Billing (http://docs.amazonwebservices.com/AWSConsolidatedBilling/1.0/AWSConsolidatedBillingGuide.html). This will let you continue to pay all at once, get volume discounts, and get a per-account breakdown of costs incurred.
http://ylastic.com provides per instance pricing as part of their service. It is not free, but I use it for monitoring, and was pleasently surprised they also provide price per instance data that looks accurate.