DEV Community

Michael Wahl for AWS Community Builders

Posted on

5

Amazon Web Services — Budgets

If you aren’t familiar, head on over and visit the AWS Billing & Cost Management Dashboard — https://console.aws.amazon.com/billing/home. Under Cost management, select Budgets, this is where you will build your very own AWS budget.
The first step in creating an AWS budget is to decide what type of budget you are looking for. For this example, I will be using a Cost budget.

Next you will need to fill in a few details for your budget. I have decided to show you both the fixed monthly amount and the monthly budget planning. The monthly budget planning allows you to set a starting amount and then budget for a % of growth per month!

You may also decide to include some additional and optional budget parameters. If you have already established a solid key/value tagging scheme, this can be really helpful to scope per workload, product or service.

Next, you will configure thresholds such as your budget threshold, set up notifications, and any budget actions which is truly magic!
Remember, if you do decide to use Budget actions, there are some specific IAM permissions that are required to execute an action on your behalf. More info on the IAM permissions is available below.

Budget Action
For this example, I have configured a budget action, where once the budget threshold I set is reached, the specific EC2 instance will be stopped and I will be notified via email, Amazon SNS or even using AWS Chatbot Alerts!

IAM Role Permissions
Trust Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "budgets.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Permissions policies
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstanceStatus",
"ec2:StartInstances",
"ec2:StopInstances",
"iam:AttachGroupPolicy",
"iam:AttachRolePolicy",
"iam:AttachUserPolicy",
"iam:DetachGroupPolicy",
"iam:DetachRolePolicy",
"iam:DetachUserPolicy",
"organizations:AttachPolicy",
"organizations:DetachPolicy",
"rds:DescribeDBInstances",
"rds:StartDBInstance",
"rds:StopDBInstance",
"ssm:StartAutomationExecution"
],
"Resource": "*"
}
]
}

Complete article and others here https://voice.michaelwahl.org/amazon-web-services-budgets-4f99ce3d17b1

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post