Skip to content

Commit 76e4caa

Browse files
CCM-14961: Allow cross domain bus to put event on DL bus (#244)
* CCM-14961: Allow cross domain bus to put event on DL bus * CCM-14961: Fix trivy vulnerability * CCM-14961: Fix trivy vulnerability * CCM-14961: Allow cross domain bus to put event on DL bus * CCM-14961: Allow cross domain bus to put event on DL bus * CCM-14961: Fix trivy vulnerabilities * CCM-14961: Remove eventbus_account_id variable * CCM-14961: Fix trivy vulnerabilities
1 parent 15a9af0 commit 76e4caa

File tree

3 files changed

+91
-20
lines changed

3 files changed

+91
-20
lines changed

infrastructure/terraform/components/dl/cloudwatch_event_bus.tf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,36 @@ resource "aws_cloudwatch_log_delivery_source" "main_trace_logs" {
2727
log_type = "TRACE_LOGS"
2828
resource_arn = aws_cloudwatch_event_bus.main.arn
2929
}
30+
31+
data "aws_iam_policy_document" "main_event_bus_document" {
32+
statement {
33+
sid = "AllowCrossDomainEventBridgeToPutEvent"
34+
effect = "Allow"
35+
36+
principals {
37+
type = "AWS"
38+
identifiers = ["arn:aws:iam::${var.shared_infra_account_id}:root"]
39+
}
40+
41+
actions = [
42+
"events:PutEvents",
43+
]
44+
45+
resources = [
46+
aws_cloudwatch_event_bus.main.arn,
47+
]
48+
49+
condition {
50+
test = "ArnLike"
51+
variable = "aws:SourceArn"
52+
values = [
53+
"arn:aws:events:${var.region}:${var.shared_infra_account_id}:rule/*-data-plane*"
54+
]
55+
}
56+
}
57+
}
58+
59+
resource "aws_cloudwatch_event_bus_policy" "main_event_bus_policy" {
60+
policy = data.aws_iam_policy_document.main_event_bus_document.json
61+
event_bus_name = aws_cloudwatch_event_bus.main.name
62+
}

package-lock.json

Lines changed: 28 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/eventcatalog/package-lock.json

Lines changed: 30 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)