Skip to content

Commit

Permalink
Merge pull request #6575 from ministryofjustice/EventBridge_Rule_CAE_…
Browse files Browse the repository at this point in the history
…130624_4

Event bridge rule cae 130624 4
  • Loading branch information
nbuckingham72 authored Jun 13, 2024
2 parents 219c832 + 8c3f55c commit e7953f9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions terraform/environments/ppud/certificate_mgmt.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
##########################################################
# EventBridge rules for certificate approaching expiration
##########################################################

resource "aws_cloudwatch_event_rule" "certificate-approaching-expiration-uat" {
count = local.is-preproduction == true ? 1 : 0
name = "Certificate-Approaching-Expiration"
description = "PPUD certificate is approaching expiration"
event_pattern = jsonencode({
"source": ["aws.acm"],
"detail-type": ["ACM Certificate Approaching Expiration"]
})
}

resource "aws_cloudwatch_event_target" "certificate-approaching-expiration-target-uat" {
count = local.is-preproduction == true ? 1 : 0
rule = aws_cloudwatch_event_rule.certificate-approaching-expiration-uat[0].name
target_id = "ppud-uat-cw-alerts"
arn = aws_sns_topic.cw_uat_alerts[0].arn
}

0 comments on commit e7953f9

Please sign in to comment.