DEV Community

Cover image for Create a Cost Alert in AWS. In One Click.
ioBasis
ioBasis

Posted on • Originally published at iobasis.com

Create a Cost Alert in AWS. In One Click.

Are your AWS costs growing? Learn how to deploy a cost alert in one click.

Often you lose track of your AWS costs. You don't know how much your team has used. Until next month' bill arrives. And many times you get a surprise. The cost was much more than expected. And now it's late to act.

On the other hand, you can check your AWS consumption regularly. You can use the AWS console for this. But it adds another task to your busy week.

But there is a more efficient way to keep track of your AWS costs.

A cost alert will keep you updated with current consumption. You will receive an email notification when costs exceed a certain level.

Sounds good! But how to configure it?

You can deploy your AWS cost alert with one click. We have defined the whole configuration in an AWS CloudFormation template.

So you can deploy it in seconds.

How does this AWS cost alert work?

This solution allows you to define a monthly budget for your AWS account. You define 2 levels (for example 50% and 90%) of your monthly budget). And you set 2 email addresses. Each one will receive an email when thresholds are exceeded.

How to deploy the AWS Cost Alert?

Now, let's see how to deploy it.

Step 1. Login to AWS

Log into AWS console using root user's credentials. This is the user that created the AWS account.

You might log in using an IAM user. But make sure it has the right privileges. The IAM user must be allowed to deploy CloudFormation templates, and also AWS Budgets. Usually, IAM users don't have these privileges. So it's not recommended.

Step 2. Create the Cost Alert

Click the link below to start deploying the cost alert.

Launch AWS Stack โ–ถ๏ธ

This will open a new window in your web browser. You will see the Quick create stack page. Scroll down and complete the following Parameters section.

First, add the 2 email addresses to receive the cost alerts. Then add the budget (default is $100). This is the monthly cost estimated for your AWS account. And then add the 2 threshold percentages.

Finally, click Create Stack. This will deploy the alert.

The alert will be provisioned within seconds. And you will get a CREATE_COMPLETE message.

That's all. You have successfully configured the cost alert. ๐Ÿ‘๐Ÿ‘๐Ÿ‘

You might also want to add more thresholds. Just deploy it again (using another name for the stack).

How to update the Cost Alert?

Note also that the Parameters tab shows current alert settings. You can update them using the Update button.

How to remove the Cost Alert?

If you want to remove the cost alert, click on the Delete button.

Conclusion

Creating a cost alert is the most important step to control your AWS costs. It's a good cost optimization practice. And it's recommended that you set it up. If you can't, share this with your account owner or admin.

If you need more ideas to control your AWS costs, you can check the How to reduce AWS Costs article.

Top comments (0)