This module seeks to create a Budget for the AWS account, accepting 1 or more alerts, we chose to use email notifications, in view of the practicality.
Below 2 examples of how to use the module, 1 with Terraform another with Terragrunt:
Terragrunt
name: "budget-aws"
budget_type : "COST"
time_unit : "MONTHLY"
limit_unit : "USD"
limit_amount: "1000"
time_period_start: "2022-10-01_00:00"
notification:
- comparison_operator : "GREATER_THAN"
threshold : 100
threshold_type : "PERCENTAGE"
notification_type : "FORECASTED"
subscriber_email_addresses : "abc@xxx.com"
-
comparison_operator : "GREATER_THAN"
threshold : 90
threshold_type : "PERCENTAGE"
notification_type : "FORECASTED"
subscriber_email_addresses :
- "abc@xxx.com"
- "def@xxx.com"
Terraform
module "budget" {
source = "osgurisdosre/budget/aws"
name = var.name
budget_type = var.budget_type["budget_type"]
limit_amount = var.limit_amount
limit_unit = var.limit_unit
time_period_start = var.time_period_start
time_unit = var.time_unit
#Accepts various notifications, just add or remove blocks {}
notification = [
{
comparison_operator = "GREATER_THAN",
threshold = 100,
threshold_type = "PERCENTAGE",
notification_type = "FORECASTED",
subscriber_email_addresses = ["abc@xxx.com", "def@xxx.com"]
},
{
comparison_operator = "GREATER_THAN",
threshold = 97,
threshold_type = "PERCENTAGE",
notification_type = "FORECASTED",
subscriber_email_addresses = ["abc@xxx.com", "def@xxx.com"]
}
]
}
Name | Version |
---|---|
terraform | >= 1.3 |
aws | >= 4.48 |
Name | Version |
---|---|
aws | >= 4.48 |
No modules.
Name | Type |
---|---|
aws_budgets_budget.budget | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
budget_type | Whether this budget tracks monetary cost or usage. | string |
"COST" |
no |
cost_filter | A list of CostFilter name/values pair to apply to budget. | list(map(string)) |
[] |
no |
cost_types | Whether this budget tracks monetary cost or usage. | list(object({ |
[ |
no |
limit_amount | The name of a budget. Unique within accounts. | number |
n/a | yes |
limit_unit | The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. | string |
"USD" |
no |
name | The name of a budget. Unique within accounts. | string |
n/a | yes |
notification | list of values to notification | list(object({ |
n/a | yes |
time_period_end | The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. | string |
"2087-06-15_00:00" |
no |
time_period_start | The start of the time period covered by the budget. If you don't specify a start date, AWS defaults to the start of your chosen time period. The start date must come before the end date. Format: 2017-01-01_12:00. | string |
null |
no |
time_unit | ) The length of time until a budget resets the actual and forecasted spend. Valid values: MONTHLY, QUARTERLY, ANNUALLY, and DAILY. | string |
"MONTHLY" |
no |
Name | Description |
---|---|
budget_name | The name of the Budget. |
Module is maintained by Emidio Neto, Leonardo Jardim and Yuri Azeredo
Apache 2 Licensed. See LICENSE for full details.