data "aws_sns_topic" "devops_team_notifications" {
  name = "infra-devops_team"
}

locals {
  nat_traffic_threshold = 22 * pow(10, 11) / 7 # 2.2 TB /7
}

/* resource "aws_cloudwatch_metric_alarm" "nat_gateway_alert" {
  count = length(module.main_nat_gateways.ids)

  alarm_name          = "${local.name_prefix}-nat_${count.index}"
  alarm_description   = "NAT incoming traffic for the past 7 days is greater than threshold"
  comparison_operator = "GreaterThanOrEqualToThreshold"

  evaluation_periods  = 1
  metric_name         = "BytesOutToSource"
  namespace           = "AWS/NATGateway"
  statistic           = "Sum"
  period              = 86400
  threshold           = local.nat_traffic_threshold
  actions_enabled     = true
  alarm_actions       = [data.aws_sns_topic.devops_team_notifications.arn]
  ok_actions          = [data.aws_sns_topic.devops_team_notifications.arn]

  dimensions = {
    NatGatewayId = module.main_nat_gateways.ids[count.index]
  }
}
 */
