It was the management guru Peter Drucker who first coined the phrase, “You can’t manage what you can’t measure.”
His insight has inspired many companies to do a better job of tracking their key performance indicators, and to base their strategic business decisions on reliable metrics.
Drucker’s adage most certainly holds true for those tasked with managing their organization’s cloud costs. Without a clear understanding of which services are being consumed, how much is being used in each category, and how much you are being charged for that usage, it is very difficult—if not impossible—to manage those costs.
The good news for AWS customers is that AWS invoices provide a wealth of detailed information about AWS cloud usage and costs. Knowing how to extract that information from the invoices can often provide visibility into how usage and cost can be optimized, without compromising performance or quality of service.
AWS Pricing 101
Before delving into how the key AWS usage reports and invoices are structured, it is important to understand how AWS services are categorized and priced. Here are the 5 main AWS billing categories:
1. Compute and Networking:
This category includes services such as AWS EC2 (virtual servers in the AWS cloud); Elastic Load Balancing (distributes network traffic across the virtual servers); Auto Scaling (automatically scales virtual servers based on demand); and AWS ECS (provides Docker containers on AWS EC2 virtual servers).
2. Storage and Content Delivery:
This category includes services such as Amazon S3 (scalable storage in the AWS cloud); CloudFront (a global content delivery network); AWS EBS (storage volumes for EC2 virtual servers), and AWS Glacier (low-cost archival storage).
This category includes products and services such as managed relational (AWS RDS or Aurora) or NoSQL (DynamoDB) databases, data warehousing (AWS Redshift), and database migration services.
4. Code Deployment and Management:
This category includes services such as AWS CodeDeploy (automated code deployment), AWS CodeBuild (building and testing code), and AWS CodePipeline (continuous delivery of released software).
5. Application Services:
This category includes services such as AWS AppStream (which hosts streaming applications and streams input and output to user devices), AWS Elastic Transcoder (converts digital media into required end-device formats), AWS SQS (allows application components to store queued data for retrieval by other components), and AWS SWF (coordinates tasks across application components).
Pricing Structures for Each Service
Each billable service has its own pricing structure. AWS EC2 On-Demand compute services, for example, are charged per virtual server instance-hour, calculated from the time an instance is launched until it is terminated or stopped.
In addition, there may be transfer costs for data transferred into or out of an AWS EC2 instance and those charges are calculated per volume in GBs. AWS Elastic Load Balancing is charged for each hour (or partial hour) that the load balancer is running and for each GB of data transferred through it.
Amazon S3 On-Demand storage services are charged per GB used, while AWS EBS provisioned storage services are charged per GBs/month. In addition, requests such as GET, PUT, POST, etc., are charged per a block number of requests, ranging from blocks of 1,000 up to 10,000. As in compute services, there may also be data transfer costs associated with storage services.
The AWS RDS On-Demand service is priced per hour per DB instance used. Its NoSQL DynamoDB, on the other hand, is priced on a monthly basis according to provisioned read and write capacity units, plus an hourly rate per GB of indexed data storage.
AWS CodeDeploy is free for code deployments to AWS EC2 instances, but there is a charge for each on-premises instance update. Any other AWS resources used during the code deployment, such as Amazon S3 buckets, will be charged accordingly.
The AWS AppStream application service is charged on an hourly basis for streaming resources actually used—plus a fixed monthly fee for each authorized user.
Rate Tiering Dependencies
Pricing rates are tiered according to:
- Volume: The higher the volume, the lower the price per unit. For example, the Amazon S3 monthly price for Standard Storage in the US East (Ohio) Availability Zone is $0.023 per GB for the first 50 TB, $0.022/GB for the next 450 TB, and $0.021 per GB for usage over 500 TB.
- Provisioning commitments: The higher the up-front commitment to a resource (vs. on-demand usage only), the lower the price. For example, the effective hourly rate of a Reserved Instance will be 21% less than the hourly On-Demand rate for the same instance class.
- Storage media type: For EBS, the type of storage media provisioned has an impact on the price rate. For example, SSD storage volumes are more expensive than magnetic disks.
- Payment terms: The rates for Reserved Instances will be lower if part of the payment is upfront, and lower still if the payment is entirely upfront. In addition, a 3-year term for a Reserved Instance will be significantly less expensive than a 1-year term.
- Data access frequency: The pricing for stored data is tiered according to the frequency of access to the data. For example, the Amazon S3 monthly price for the first 50 TB of Standard Storage (frequently accessed data) is $0.023/GB, for Standard-Infrequent Access Storage it is $0.0125/GB, and for Glacier Storage (for archived data) it is $0.004/GB.
Another factor that impacts the AWS invoice is in which Availability Zone region(s) the service was provided—prices vary from region to region based on different latencies and data transfer speeds. Last but not least, if you have used AWS Organizations to apply centralized policies to multiple AWS accounts, the combined usage of all of the consolidated accounts is used to calculate volume discounts.
The Structure of an AWS Billing Item
This section outlines some particularly informative columns that will appear per billed item in the monthly AWS invoice.
Note that AWS can also provide a Cost and Usage Report that is structured in the same way as the invoice and gives a near-real-time listing of estimated charges since the previous invoice.
The Cost and Usage Report is made available several times a day as a CSV file in a user-specified Amazon S3 bucket.
Line Item Information
For each billable operation, the line item columns in the billing report provide important information on the type of usage, where it took place, when it took place, the resources consumed and the applicable rates, such as:
- UsageAccountId: The ID of the account. Note that if you have consolidated accounts, the bill itself is issued under the UserAcountID of the Master account, but sub-line items will then identify the individual accounts under which the usage actually took place.
- UsageStartDate: The date when the usage for this line item started.
- UsageEndDate: The date when the usage for this line item ended.
- Usage Type: The type of usage covered by this line item, such as On-Demand, Spot (an instance whose price is determined by bidding for unused server capacity), Reserved, an RDS node, etc. Note: If you paid for a Reserved Instance, this column has one line that shows the monthly committed cost, and multiple lines that show a charge of 0.
- Availability Zone: The Availability Zone in which the AWS operation was carried out. As noted above, pricing for the same service will vary among Availability Zone regions.
- Usage Amount: The actual usage of non-reserved (i.e., On-Demand) resources incurred by the operation. As described above, the unit of usage (hours, GBs, number of requests, etc.) is service-specific.
- Blended Rate/Cost: In consolidated billing, the blended rate is the averaged rate and calculated cost of all of the Reserved Instances and On-Demand Instances used by the member accounts as calculated at the master account level. Those rates and charges are then allocated back to the member accounts in proportion to the member account’s usage.
For each billable operation, the billing report provides detailed pricing information. This information includes:
- PublicOnDemandCost/Rate: These two fields together show the total cost for the operation in question, based on public on-demand rates.
- PurchaseOption: How you have chosen to pay for this operation, with the valid options being All Upfront, Partial Upfront, or No Upfront.
- RateType: The type of rate that applies to this line item, such as Fixed.
- Rate Unit: The unit used to calculate the usage cost, e.g., hours, GBs, number of requests, etc.
- Term: Whether the usage is On-Demand or Reserved.
These line item fields provide important information on Reserved Instances:
- AvailabilityZone: The Availability Zone of the reserved resource.
- NumberOfReservations: The number of Reserved Instances covered by the subscription.
- UnitsPerReservation: The number of usage units reserved by a single reservation in a given subscription, e.g., how many hours a single AWS EC2 RI has reserved.
- TotalReservedUnits: The total number of hours across all RIs in this subscription, i.e., the NumberOfReservations multipled by the UnitsPerReservation.
In addition to understanding AWS Storage Costs and Usage Reports and detailed monthly invoices, AWS provides tools to help its customers track real-time usage (e.g., the dashboard) or view historical usage and predict usage requirements (e.g., the Cost Explorer).
You can also assign key-value cost allocation tags to group your AWS costs according to, for example, your organization’s cost centers or applications.
Cost allocation tags can be particularly helpful in identifying underutilized resources, such as unused Reserved Instances -- visibility that you can use to optimize your AWS services.
- 3 Tips for Optimizing AWS EBS Usage
- Best Practices and Tips for Optimizing AWS EMR
- Managing EBS Volumes in the AWS Cloud