AWS Startups Blog
The Startup Quick Guide to Managing Budgets, Credits, and AWS Resources
As an AWS startup solutions architect I work closely with early stage startups, helping them with general guidance, performing architecture reviews, discussing best practices, security, reliability, cost optimization, and other general questions.
A common discussion I have with startups is about how to track their AWS costs, credits (learn more about credits), and how to figure out what resources they are currently using.
Where are my credits?
The credits section can be found under the account billing section. To get to the account section, click on the account name in the AWS console (top menu) and select “My Account.”
In the account section, under billing, you can find the credits menu option.
On the credits page you will see your current credits, expiration date, amount used, amount remaining, and a link to a complete list of applicable products covered by the credits.
Which services am I using and billed for?
An easy way to figure out the services being used is to navigate to the billing section and look at the current and previous bills. The bill page will show all the services that the account is billed for. Expanding each service will show a drill down to different regions and specific usage.
How do I manage resources across multiple services and understand their cost?
A common question I get is how to figure out the cost of my dev/production environments that consist of different services, such as, EC2, RDS, Lambda functions, ELB, etc.
The answer for this question is usually answered by using tags on AWS resources. For example, you can create an environment tag name, the value could be dev or production, and assign it to an EC2, RDS, Lambda, and other services. Then you can create a cost allocation tags in the cost management section in your account.
Here are few examples for setting tags on AWS resources:
When launching an EC2 instance, part of the wizard, you can add tags. In this example we are using the following tags
- Key: Name, Value: API (this would be the name for the EC2 instance)
- Key: Environment, Value: Dev (this indicates that the instance is going to be part of the dev environment)
- Key: Product, Value: Customer-Mail-API (this indicates that the instance will be part of the mentioned product)
You can also assign tags to a running EC2 instance, by navigating to the EC2 instances page, select the instance you would like to tag, then click on the Actions button -> Instance Settings -> Add/Edit Tags.
Here’s an example for adding tags to a Lambda function. After creating the function, in the edit screen, navigate to the tags sections and add the tags.
The next thing you will need to do is activate the cost allocation tags. For doing that, navigate to your account section (same place as the billing pages) and click on the “Cost allocation tags” from the side menu.
On the cost allocation tags page, click on the “Activate” button.
Afterwards, choose the tags you would like to use (i.e. Environment, Product, etc.) and click on Activate.
It will take up to 24 hours before you can use these tags to explore costs and set budgets.
How do I set a budget and track costs?
Other common questions I get are: Can I track my costs? What’s the best way to set up notifications that track my credit consumption? Can I track costs by environment?
To answer these questions we are going to setup AWS Budgets and track the actual spend. You can find AWS Budgets under the account section (same as billing).
On the budgets screen, click on the “Create a budget” button to create a new budget.
The first budget we want to create is a general one to track all usage costs. For that choose the “Cost budget” option.
In the next screen you can set the budget options.
Name – the name for the budget (i.e. Monthly Budget)
Period – the period we want to track. For this example, we will use Monthly
Budget effective date – for a monthly recurring budget select the “Recurring Budget”
Budget amount – use “Fixed” for single monthly budget amount
Budgeted amount – the amount for the budget
Advanced Options – make sure the credits options is not checked, otherwise you won’t track the costs if paying with credits.
In the next screen you will be able to set alerts. You can set alerts for when an actual or forecasted costs breach a threshold. In this example the alert is set for when reaching 50% of the actual budget.
You can send the alerts to an email address, and also can notify using an SNS topic. A good practice for sending budget emails is to create an alias in your email domain and send it to all relevant recipients.
When finished, confirm the budget.
We can also create a budget by using the cost allocation tags (you will need to wait a day after enabling the cost allocation tags for this option to be available).
Here’s an example of creating another cost budget using the cost allocation tags. Under the Budget parameters, you will be able to choose the cost allocation tags.
On the budgets main page, you can see the budgets you have created and their current status.
If the current usage breaches the budget alert threshold and you configured to send emails, you will get something like the following.
And you could also see that on the budgets page.
Further reading
AWS Credits – AWS credits are applied to bills to help cover costs that are associated with eligible services.
Analyzing Your Costs with Cost Explorer – Cost Explorer is a free tool that you can use to view your costs.
Using Cost Allocation Tags – You can use tags to organize your resources and cost allocation tags to track your AWS costs on a detailed level.
Avoiding Unexpected Charges – Some suggestions to help you avoid unexpected charges on your bill.