Skip to content

Commit 0d1807e

Browse files
committed
CCM-14347: Send Print config
1 parent fd24d89 commit 0d1807e

2 files changed

Lines changed: 25 additions & 25 deletions

File tree

infrastructure/terraform/components/dl/cloudwatch_event_bus.tf

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,6 @@ resource "aws_cloudwatch_event_bus" "main" {
99
}
1010
}
1111

12-
resource "aws_cloudwatch_event_bus_policy" "main_event_bus" {
13-
policy = data.aws_iam_policy_document.main_event_bus.json
14-
event_bus_name = aws_cloudwatch_event_bus.main.name
15-
}
16-
17-
data "aws_iam_policy_document" "main_event_bus" {
18-
statement {
19-
sid = "AllowSNSPublish"
20-
effect = "Allow"
21-
22-
principals {
23-
type = "Service"
24-
identifiers = ["events.amazonaws.com"]
25-
}
26-
27-
actions = [
28-
"sns:Publish"
29-
]
30-
31-
resources = [
32-
module.eventpub.sns_topic.arn
33-
]
34-
}
35-
}
36-
3712
# CloudWatch Log Delivery Sources for INFO, ERROR, and TRACE logs
3813
resource "aws_cloudwatch_log_delivery_source" "main_info_logs" {
3914
name = "EventBusSource-${aws_cloudwatch_event_bus.main.name}-INFO_LOGS"

infrastructure/terraform/components/dl/modules_eventpub.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,28 @@ module "eventpub" {
2828
data_plane_bus_arn = var.eventpub_data_plane_bus_arn
2929
control_plane_bus_arn = var.eventpub_control_plane_bus_arn
3030
}
31+
32+
resource "aws_sns_topic_policy" "eventbridge_publish" {
33+
arn = module.eventpub.sns_topic.arn
34+
policy = data.aws_iam_policy_document.sns_publish.json
35+
}
36+
37+
data "aws_iam_policy_document" "sns_publish" {
38+
statement {
39+
sid = "AllowEventBridgePublish"
40+
effect = "Allow"
41+
42+
principals {
43+
type = "Service"
44+
identifiers = ["events.amazonaws.com"]
45+
}
46+
47+
actions = [
48+
"sns:Publish"
49+
]
50+
51+
resources = [
52+
module.eventpub.sns_topic.arn
53+
]
54+
}
55+
}

0 commit comments

Comments
 (0)