Skip to content

Commit 1574fed

Browse files
feat: add EKS/RDS Extended Support Eventbridge rules (#65)
* feat: add EKS/RDS Extended Support Eventbridge rules * feat: enable optionally disabling the eks/rds alerts * docs: update terraform module docs
1 parent 0772b34 commit 1574fed

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ module "account_baseline_alarms" {
5050
| <a name="input_create_sns_topic"></a> [create\_sns\_topic](#input\_create\_sns\_topic) | The boolean flag whether to create the SNS topic for alarms. | `bool` | `true` | no |
5151
| <a name="input_enable_administrator_sso_activity"></a> [enable\_administrator\_sso\_activity](#input\_enable\_administrator\_sso\_activity) | The boolean flag whether the administrator\_sso\_activity alarm is enabled or not. | `bool` | `true` | no |
5252
| <a name="input_enable_aws_config_changes"></a> [enable\_aws\_config\_changes](#input\_enable\_aws\_config\_changes) | The boolean flag whether the aws\_config\_changes alarm is enabled or not. | `bool` | `true` | no |
53+
| <a name="input_enable_aws_extended_support_alerts"></a> [enable\_aws\_extended\_support\_alerts](#input\_enable\_aws\_extended\_support\_alerts) | The boolean flag whether the eventbridge rules for extended support (EKS/RDS) billing alerts are enabled or not. | `bool` | `true` | no |
5354
| <a name="input_enable_breakglass_activity"></a> [enable\_breakglass\_activity](#input\_enable\_breakglass\_activity) | The boolean flag whether the breakglass\_logins alarm is enabled or not. | `bool` | `true` | no |
5455
| <a name="input_enable_cloudtrail_cfg_changes"></a> [enable\_cloudtrail\_cfg\_changes](#input\_enable\_cloudtrail\_cfg\_changes) | The boolean flag whether the cloudtrail\_cfg\_changes alarm is enabled or not. | `bool` | `true` | no |
5556
| <a name="input_enable_console_signin_failures"></a> [enable\_console\_signin\_failures](#input\_enable\_console\_signin\_failures) | The boolean flag whether the console\_signin\_failures alarm is enabled or not. | `bool` | `true` | no |

eventbridge.tf

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
}

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ variable "enable_aws_config_changes" {
8686
default = true
8787
}
8888

89+
variable "enable_aws_extended_support_alerts" {
90+
description = "The boolean flag whether the eventbridge rules for extended support (EKS/RDS) billing alerts are enabled or not."
91+
type = bool
92+
default = true
93+
}
94+
8995
variable "enable_security_group_changes" {
9096
description = "The boolean flag whether the security_group_changes alarm is enabled or not."
9197
type = bool

0 commit comments

Comments
 (0)