Skip to content

Commit b70b035

Browse files
CCM-15019: terraform changes to publish events
1 parent 95e89cc commit b70b035

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
resource "aws_cloudwatch_event_rule" "data_plane" {
2+
name = "${local.csi}-data-plane"
3+
description = "Data plane event rule"
4+
event_bus_name = aws_cloudwatch_event_bus.main.name
5+
6+
event_pattern = jsonencode({
7+
"detail" : {
8+
"plane" : [
9+
"data"
10+
],
11+
}
12+
})
13+
}
14+
15+
resource "aws_cloudwatch_event_target" "data-plane-main-bus-target" {
16+
rule = aws_cloudwatch_event_rule.data_plane.name
17+
arn = module.eventpub.sns_topic.arn
18+
event_bus_name = aws_cloudwatch_event_bus.main.name
19+
20+
input_path = "$.detail"
21+
}

infrastructure/terraform/components/dl/modules_eventpub.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ data "aws_iam_policy_document" "sns_publish" {
6060
condition {
6161
test = "ArnEquals"
6262
variable = "aws:SourceArn"
63-
values = [aws_cloudwatch_event_rule.letter_prepared.arn]
63+
values = [aws_cloudwatch_event_rule.letter_prepared.arn,
64+
aws_cloudwatch_event_rule.data_plane.arn
65+
]
6466
}
6567
}
6668
}

0 commit comments

Comments
 (0)