We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7edda52 commit edd7df0Copy full SHA for edd7df0
1 file changed
infrastructure/terraform/components/dl/sns_topic.tf
@@ -1,3 +1,33 @@
1
resource "aws_sns_topic" "main" {
2
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
33
}
0 commit comments