Skip to content

clearview/aws_budgets_notifications_with_terraform

Repository files navigation

AWS Budgets and Notifications with Terraform

Monthly Account Budget

Alt text

resource "aws_budgets_budget" "apprunner_monthly_budget" {
name = "My AppRunner Monthly Budget"
budget_type = "COST"
limit_amount = "100"
limit_unit = "USD"
time_unit = "MONTHLY"
cost_filter {
name = "Service"
values = [
"AWS App Runner",
]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 90
threshold_type = "PERCENTAGE"
notification_type = "ACTUAL"
subscriber_email_addresses = ["email@my.team"]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 110
threshold_type = "PERCENTAGE"
notification_type = "FORECASTED"
subscriber_email_addresses = ["email@my.team"]
}
}

Budgets based on service filtering

EC2 Monthly Budget

Alt text

resource "aws_budgets_budget" "ec2_monthly_budget" {
name = "My EC2 Monthly Budget"
budget_type = "COST"
limit_amount = "400"
limit_unit = "USD"
time_unit = "MONTHLY"
cost_filter {
name = "Service"
values = [
"Amazon Elastic Compute Cloud - Compute",
]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 90
threshold_type = "PERCENTAGE"
notification_type = "ACTUAL"
subscriber_email_addresses = ["email@my.team"]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 100
threshold_type = "PERCENTAGE"
notification_type = "FORECASTED"
subscriber_email_addresses = ["email@my.team"]
}
}

S3 Monthly Budget

Alt text

resource "aws_budgets_budget" "s3_monthly_budget" {
name = "My S3 Monthly Budget"
budget_type = "COST"
limit_amount = "100"
limit_unit = "USD"
time_unit = "MONTHLY"
cost_filter {
name = "Service"
values = [
"Amazon Simple Storage Service",
]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 90
threshold_type = "PERCENTAGE"
notification_type = "ACTUAL"
subscriber_email_addresses = ["email@my.team"]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 110
threshold_type = "PERCENTAGE"
notification_type = "FORECASTED"
subscriber_email_addresses = ["email@my.team"]
}
}

AppRunner Monthly Budget

Alt text

resource "aws_budgets_budget" "apprunner_monthly_budget" {
name = "My AppRunner Monthly Budget"
budget_type = "COST"
limit_amount = "100"
limit_unit = "USD"
time_unit = "MONTHLY"
cost_filter {
name = "Service"
values = [
"AWS App Runner",
]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 90
threshold_type = "PERCENTAGE"
notification_type = "ACTUAL"
subscriber_email_addresses = ["email@my.team"]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 110
threshold_type = "PERCENTAGE"
notification_type = "FORECASTED"
subscriber_email_addresses = ["email@my.team"]
}
}

Budgets based on tag filtering

Production Tag Monthly Budget

Alt text

resource "aws_budgets_budget" "my_production_monthly_budget" {
name = "My Production Monthly Budget"
budget_type = "COST"
limit_amount = "400"
limit_unit = "USD"
time_unit = "MONTHLY"
cost_filter {
name = "TagKeyValue"
values = [
"environment$Production",
]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 90
threshold_type = "PERCENTAGE"
notification_type = "ACTUAL"
subscriber_email_addresses = [
"email1@my.team",
"email2@my.team"
]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 110
threshold_type = "PERCENTAGE"
notification_type = "FORECASTED"
subscriber_email_addresses = [
"email1@my.team",
"email2@my.team"
]
}
}

Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages