Skip to content

Commit edd7df0

Browse files
committed
CCM-15020: Allow cross-domain publishing to SNS topic
1 parent 7edda52 commit edd7df0

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
11
resource "aws_sns_topic" "main" {
22
name = "${local.csi}-test"
3+
4+
policy = data.aws_iam_policy_document.sns_topic_policy_document.json
5+
}
6+
7+
data "aws_iam_policy_document" "sns_topic_policy_document" {
8+
statement {
9+
sid = "AllowCrossDomainEventBridgeToPublishMessageToSNS"
10+
effect = "Allow"
11+
12+
principals {
13+
type = "AWS"
14+
identifiers = ["arn:aws:iam::${var.shared_infra_account_id}:root"]
15+
}
16+
17+
actions = [
18+
"sns:Publish",
19+
]
20+
21+
resources = [
22+
aws_sns_topic.main.arn,
23+
]
24+
25+
condition {
26+
test = "ArnLike"
27+
variable = "aws:SourceArn"
28+
values = [
29+
"arn:aws:events:${var.region}:${var.shared_infra_account_id}:rule/*-data-plane*"
30+
]
31+
}
32+
}
333
}

0 commit comments

Comments
 (0)