Patterned Designs HCL Module Registry
v0.1.0 latest View all versions

Terraform module for cost-controls on aws

View Full Documentation Usage guides, examples & best practices
module "cost-controls" {
  source  = "registry.patterneddesigns.ca/governance/cost-controls/aws"
  version = "0.1.0"
}
budget_name required
string

Name for the AWS Budget. Must be unique within your AWS account. Can contain alphanumeric characters, hyphens, underscores, and periods. Maximum 100 characters.

Constraints
  • Budget name must contain only alphanumeric characters, periods, underscores, hyphens and be at most 100 characters.
budget_limit required
number

Monthly budget limit in USD. Sets the maximum expected spend for the budget period and is used as the baseline for calculating alert thresholds.

Constraints
  • Budget limit must be a positive number.
alert_thresholds
list(number) default: [50, 80, 100]

Percentage thresholds for budget alerts. Multiple thresholds provide early warning as spending increases. Common patterns: conservative [25, 50, 75, 90, 100], standard [50, 80, 100], aggressive [80, 100, 110].

Constraints
  • At least one alert threshold must be specified.
notification_emails
list(string) default: null

Email addresses for budget notifications. AWS Budgets will send emails directly to these addresses when thresholds are exceeded. Use team distribution lists rather than individual emails.

Constraints
  • All notification emails must be valid email addresses.
sns_topic_arn
string default: null

ARN of SNS topic for budget notifications. Allows budget alerts to be published to an existing SNS topic for integration with other notification workflows, automation, and third-party tools. Set to null to skip SNS integration.

Constraints
  • SNS topic ARN must be a valid ARN format (arn:aws:sns:region:account-id:topic-name).
budget_arn

ARN of the created AWS Budget. Use this for IAM policies and resource references.

sns_topic_arn

ARN of the SNS topic used for budget notifications. Available when the module creates its own SNS topic or when an existing topic is provided.

budget_name

Name of the created AWS Budget as created in the AWS account. Use this for API calls and CLI commands.