|
| 1 | +# EventBridge Rule (RDS Extended Support Billing) |
| 2 | +resource "aws_cloudwatch_event_rule" "rds_extended_support_billing" { |
| 3 | + count = var.enable_aws_extended_support_alerts ? 1 : 0 |
| 4 | + name = "rds-extended-support-billing-notification" |
| 5 | + description = "Captures AWS Billing notifications for RDS Extended Support" |
| 6 | + |
| 7 | + event_pattern = jsonencode({ |
| 8 | + "source" : ["aws.health"], |
| 9 | + "detail-type" : ["AWS Health Event"], |
| 10 | + "detail" : { |
| 11 | + "eventTypeCode" : ["AWS_BILLING_NOTIFICATION"], |
| 12 | + "eventDescription" : [{ |
| 13 | + "wildcard" : "*RDS Extended Support*" |
| 14 | + }] |
| 15 | + } |
| 16 | + }) |
| 17 | +} |
| 18 | + |
| 19 | +resource "aws_cloudwatch_event_target" "rds_extended_support_billing" { |
| 20 | + count = var.enable_aws_extended_support_alerts ? 1 : 0 |
| 21 | + rule = aws_cloudwatch_event_rule.rds_extended_support_billing[0].name |
| 22 | + arn = local.sns_topic_arn |
| 23 | +} |
| 24 | + |
| 25 | +# EventBridge Rule (EKS Extended Support Billing) |
| 26 | +resource "aws_cloudwatch_event_rule" "eks_extended_support_billing" { |
| 27 | + count = var.enable_aws_extended_support_alerts ? 1 : 0 |
| 28 | + name = "eks-extended-support-billing-notification" |
| 29 | + description = "Captures AWS Billing notifications for EKS Extended Support" |
| 30 | + |
| 31 | + event_pattern = jsonencode({ |
| 32 | + "source" : ["aws.health"], |
| 33 | + "detail-type" : ["AWS Health Event"], |
| 34 | + "detail" : { |
| 35 | + "eventTypeCode" : ["AWS_BILLING_NOTIFICATION"], |
| 36 | + "eventDescription" : [{ |
| 37 | + "wildcard" : "*EKS Extended Support*" |
| 38 | + }] |
| 39 | + } |
| 40 | + }) |
| 41 | +} |
| 42 | + |
| 43 | +resource "aws_cloudwatch_event_target" "eks_extended_support_billing" { |
| 44 | + count = var.enable_aws_extended_support_alerts ? 1 : 0 |
| 45 | + rule = aws_cloudwatch_event_rule.eks_extended_support_billing[0].name |
| 46 | + arn = local.sns_topic_arn |
| 47 | +} |
0 commit comments