File tree Expand file tree Collapse file tree
infrastructure/terraform/components/dl Expand file tree Collapse file tree Original file line number Diff line number Diff 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
3813resource "aws_cloudwatch_log_delivery_source" "main_info_logs" {
3914 name = " EventBusSource-${ aws_cloudwatch_event_bus . main . name } -INFO_LOGS"
Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments