2022-12-02 10:59:40 +08:00
resource " aws_cloudwatch_event_rule " " EventRule " {
name = " ${ var . cw - alarm - prefix } -health-events "
description = " A CloudWatch Event Rule that triggers on changes in the status of AWS Personal Health Dashboard (AWS Health) and forwards the events to an SNS topic. "
is_enabled = var . actions - enabled
event_pattern = < < PATTERN
{
" detail-type " : [
" AWS Health Event "
] ,
" source " : [
" aws.health "
]
}
PATTERN
tags = var . default - tags
2022-12-06 14:35:13 +08:00
lifecycle {
ignore_changes = [ tags ]
}
2022-12-02 10:59:40 +08:00
}
resource " aws_cloudwatch_event_target " " TargetForEventRule " {
rule = aws_cloudwatch_event_rule . EventRule . name
target_id = " rackspace-standard-sns "
arn = var . sns - targets . alarm - actions - standard
}