sns_topic_arn

Type 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.

SNS Integration

The SNS topic ARN allows budget alerts to be published to an existing SNS topic, enabling integration with other notification workflows, automation, and third-party tools.

Example Configuration

sns_topic_arn = "arn:aws:sns:us-east-1:123456789012:budget-alerts"

Integration Options

IntegrationDescription
Slack/TeamsForward alerts to chat channels via Lambda
PagerDutyTrigger incidents for critical budget alerts
LambdaAutomate cost optimization actions
SQSQueue alerts for batch processing
Email listsAdditional email distribution beyond direct emails

Best Practices

  • Create a dedicated SNS topic for cost alerts
  • Configure appropriate access policies on the SNS topic
  • Use cross-account SNS for centralized cost management
  • Enable message filtering for selective routing
  • Consider encryption for sensitive cost data

Example: Creating an SNS Topic

resource "aws_sns_topic" "budget_alerts" {
  name = "budget-alerts"
}

resource "aws_sns_topic_policy" "budget_alerts" {
  arn = aws_sns_topic.budget_alerts.arn

  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Effect    = "Allow"
      Principal = { Service = "budgets.amazonaws.com" }
      Action    = "SNS:Publish"
      Resource  = aws_sns_topic.budget_alerts.arn
    }]
  })
}

Full Module Example

module "cost_controls" {
  source  = "registry.patterneddesigns.ca/governance/cost-controls/aws"
  version = "0.1.0"

  # sns_topic_arn
  sns_topic_arn = "..."

  # Other required inputs
  budget_name = "..."
  budget_limit = "..."
}