Performance and cost · 12 min
Cost principles and tools to see your spending
In this lesson you will learn what the five design principles of the cost optimization pillar are and when to use AWS Cost Explorer, AWS Budgets, AWS Data Exports, cost allocation tags, consolidated billing and AWS Compute Optimizer.
The AWS Well-Architected Framework is the AWS guide with the best practices for designing systems in the cloud, and it divides them into pillars, which are the topics it reviews, such as security or cost. Behind each specific cost decision, such as which S3 storage class, which EBS volume or which EC2 purchasing option to use, are the design principles of the cost optimization pillar. To apply them, AWS has tools that show you where the money goes, and on the SAA-C03 exam they are chosen by what each one does. For example, an online store that gets an AWS bill higher than the previous month uses those principles to decide what to change and those tools to find out where the spending came from.
Design principles of the cost pillar

The cost optimization pillar has five design principles, which apply to each workload:
- Implement Cloud Financial Management, which means dedicating time, people and processes to understanding and optimizing spending, just as the company does with security or operations.
- Adopt a consumption model, which means paying only for what you use and scaling capacity up or down based on what the business needs.
- Measure overall efficiency, which means comparing what the workload delivers with what it costs to deliver it, so you know whether it makes more sense to produce more or spend less.
- Stop spending money on undifferentiated heavy lifting, which means leaving to AWS what doesn't set your business apart, such as operating data centers or, with a managed service, managing the operating system and the application.
- Analyze and attribute expenditure, which means knowing which workload generated each cost and charging it to the team that owns it, so that each team sees how much value it gets from what it spends and optimizes its own share.
For example, the store applies the third principle when it measures how much each order it sells costs it on AWS: if it sells more orders with the same spending, its system is more efficient. It applies the fifth when it separates the catalog team's spending from the payments team's spending.
The second principle comes with an example with numbers. A development environment, which is the computers where programmers test their changes, is used 8 hours a day on weekdays and is running 40 of the 168 hours in a week. If you turn it off the rest of the time, AWS calculates that you save 75%.
Which principle applies?
0 of 4Tap the principle that each decision follows.
A schedule turns off the test instances at 8 p.m. and turns them on at 8 a.m.
Moving a PostgreSQL database installed on EC2 to Amazon RDS
Each resource carries the tag of the team that created it and each team receives its spending report
The company forms a finance and technology team that reviews cloud spending every month
Tools to see your spending

AWS has three tools to see your spending, and each one does something different with the data:
- AWS Cost Explorer, which shows your cost and usage in charts you can filter.
- AWS Budgets, which alerts you when spending goes over an amount you set.
- AWS Data Exports, which sends the cost and usage detail to files that you query with SQL or turn into charts with Amazon QuickSight, the AWS reporting service.
To avoid confusing them, think about what you want to do with the data. If you want to look at it and understand it, you use Cost Explorer; if you want to be alerted or have something happen before you go over, you use Budgets; and if you want to take each line of the bill to another tool, you use Data Exports. For example, the store's owner opens Cost Explorer to see which service went up this month, creates a budget in Budgets so she gets an email if spending shoots up, and her data team uses Data Exports to match the bill against sales.
AWS Cost Explorer
Cost Explorer goes back up to 13 months, forecasts the next 18 and recommends which Reserved Instances to buy. Its console is free, while its API charges 0.01 USD per paginated request, which is each page of results a program asks for. The data is updated at least once every 24 hours, so what you spent an hour ago may not show up yet. For example, the store can see in Cost Explorer how much it spent on EC2 in each of the last six months.
AWS Budgets
In Budgets you set an amount, and the service alerts you by email or through an Amazon SNS topic, which is a channel that delivers alerts to emails, phones or programs, when actual or forecasted spending goes past the limit you set. Besides cost budgets, there are usage budgets and Reserved Instances and Savings Plans utilization or coverage budgets, which measure whether you are using the discounts you bought. A budget can also run an action, such as applying an IAM policy that prevents creating more resources. For example, a school that gives practice accounts to its students can make it so that, when the budget is exceeded, those accounts can no longer create servers.
AWS Data Exports
Data Exports is the tool to receive the most detailed billing data, with one line for each charge. That is where you find the Cost and Usage Report 2.0 (CUR 2.0), which is the recommended way to receive that detail. For example, a finance team that wants to combine AWS spending with its own accounting system receives the CUR 2.0 and loads it there.
Cost allocation tags
To attribute spending to a team or a project, you use tags. A tag is a key-value pair that you put on a resource, for example team with the value payments. However, adding it isn't enough to see it in Cost Explorer or in the reports, because first you have to activate it as a cost allocation tag.
The tags you define carry the user: prefix, and the ones AWS creates carry aws: (such as aws:createdBy). Each of those two types is activated separately. For example, the store puts the team tag on all its servers, and it also has to activate the aws:createdBy tag if it wants to see spending by who created each resource.

A tag that isn't activated doesn't appear in any report. Reports grouped by tag also include the resources that don't have it, so the total still matches the bill. For example, if the store forgot to tag a disk, its cost shows up in an untagged group and isn't lost from the total.
AWS Organizations consolidated billing
Many companies use several AWS accounts, for example one per team, and AWS Organizations is the service that groups them. AWS Organizations consolidated billing brings everything together in a single bill that the management account pays, which is the organization's main account. It also adds up the usage of all the accounts, and with that the accounts share volume discounts, Reserved Instances and Savings Plans. For example, if the store has one account for sales and another for testing, it receives a single bill and the discount one account doesn't use is used by the other.
Rightsizing recommendations with AWS Compute Optimizer
Compute Optimizer reviews the configuration and usage metrics of your resources, and with that it recommends the right size (rightsizing) or flags idle resources, which are the ones you pay for and almost nobody uses. It covers EC2 instances, Auto Scaling groups, EBS volumes, Lambda functions, ECS services on Fargate, RDS and Aurora, DynamoDB, ElastiCache, NAT gateways and more. For example, if one of the store's servers never uses more than a small part of its processor, Compute Optimizer recommends a smaller, cheaper one.
Before using it you have to turn it on (opt in), and it doesn't recommend anything until it collects enough metrics. From the management account of an organization, Compute Optimizer sees all the accounts. For example, if the store turns it on today, it has to wait for it to collect data before it sees the first recommendation.
Match each need with its tool
0 of 5 pairsTap a need and then the tool.
0 of 5 pairs.
If your account uses the new experience
In a new experience account, Cost Explorer, AWS Budgets and Compute Optimizer are in the free plan. AWS Organizations isn't, so you don't have consolidated billing. Data Exports and the Cost and Usage Report don't appear in the new experience service lists, so don't count on them. For example, you can create a budget that sends you an email, but you can't bring several accounts together in one bill.
On the exam
The questions on this topic describe what someone wants to know or avoid. These words in the question point to the tool:
- "Alert", "notification" or "before going over budget", which point to Budgets.
- "Visualize", "trends" or "forecast", which point to Cost Explorer.
- "The most detailed report" or "take the billing data to another tool", which point to Data Exports (CUR 2.0).
- "By department", "by project" or "cost center", which point to activated cost allocation tags.
- "Overprovisioned", "idle" or "right size", which point to Compute Optimizer.
- "Several accounts" together with "share discounts" or "a single bill", which point to consolidated billing.
For example, if the question says "the director wants to get an alert before the month's spending goes over the budget", the answer is Budgets.
Review question
A company has 30 accounts in AWS Organizations and several projects share accounts. Finance needs to know every month how much each project spends. All the resources already carry the "project" tag, but it doesn't appear as a filter in Cost Explorer. What is missing?
Next
- Design principles, the five principles of the cost optimization pillar of the AWS Well-Architected Framework.
- Take a Solutions Architect practice exam at /examenes and review your result in the cost-optimized architectures domain.