TerraShelf

Catalog · Cost · v1.0.0

budget-guard

Monthly cost budget that notifies at 50, 80, and 100 percent.

Tests passed 5 of 5. Failed 0.

Inputs

NameTypeRequiredDescription
email_addresseslist(string)noEmail addresses notified with the SNS topic. Empty notifies only the topic.
limit_amountnumberyesMonthly cost budget amount in USD. Required. Values in examples are placeholders, not recommendations.
name_prefixstringyesPrefix for the budget and the notification topic.
tagsmap(string)noExtra tags merged onto every taggable resource. ManagedBy and Module are always set by the module.

Outputs

NameDescription
caller_contextAccount, partition, and region resolved from data sources.
email_subscription_countEmail subscriptions on the budget topic. Zero when email_addresses is empty.
limit_amountBudget limit as planned. Example values are placeholders, not recommendations.
notification_countHow many budget notifications are configured.
notification_thresholdsPercentage thresholds notified for the monthly budget. Fixed at 50, 80, and 100.
notification_typesNotification types sent at each threshold.
tag_auditTags on every taggable resource this module creates.
topic_nameSNS topic name that receives budget notifications.

Example

The caller supplies the region. This example does not embed an account id.

module "budget" {
  source = "../.."

  name_prefix  = "demo-cost"
  limit_amount = 1
  tags = {
    Example = "basic"
  }
}

Tests

Mock plan excerpt

mocked provider: ARNs and IDs are simulated. This excerpt is from terraform test with a mocked provider, not a live plan.

mocked provider: ARNs and IDs are simulated. This is terraform test -verbose, not a live plan.

tests\budget-guard.tftest.hcl... in progress
  run "placeholder_amount"... pass

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_budgets_budget.monthly will be created
  + resource "aws_budgets_budget" "monthly" {
      + account_id        = (known after apply)
      + arn               = (known after apply)
      + budget_type       = "COST"
      + id                = (known after apply)
      + name              = "demo-cost-monthly-cost"
      + name_prefix       = (known after apply)
      + tags              = {
          + "ManagedBy" = "terraform"
          + "Module"    = "budget-guard"
          + "Owner"     = "platform"
        }
      + tags_all          = (known after apply)
      + time_period_start = (known after apply)
      + time_unit         = "MONTHLY"

      + notification {
          + comparison_operator       = "GREATER_THAN"
          + notification_type         = "ACTUAL"
          + subscriber_sns_topic_arns = [
              + (known after apply),
            ]
          + threshold                 = 100
          + threshold_type            = "PERCENTAGE"
        }
      + notification {
          + comparison_operator       = "GREATER_THAN"
          + notification_type         = "ACTUAL"

Resources

graphviz dot was not installed. The figure is a python-hcl2 resource list.

Resource list for budget-guard

Changelog

Changelog

All notable changes to this module are documented in this file.

The format is based on Keep a Changelog, and this module uses Semantic Versioning.

[1.0.0] - 2026-10-03

Added

Billable item names

Names only. This page does not quote a price. Example amounts, including a budget limit, are placeholders and are not recommendations. GuardDuty and Security Hub stay off unless a module switch is set, because those services are billable.