Skip to content

Commit 80bd61a

Browse files
committed
CCM-12995: Adding sns topic policy for sub
1 parent 6c7bc30 commit 80bd61a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

infrastructure/terraform/modules/eventsub/sns_topic_policy.tf

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
resource "aws_sns_topic" "main" {
2-
name = "my-topic-with-policy"
3-
}
4-
51
resource "aws_sns_topic_policy" "main" {
62
arn = aws_sns_topic.main.arn
73

@@ -41,7 +37,7 @@ data "aws_iam_policy_document" "sns_topic_policy" {
4137
}
4238

4339
resources = [
44-
aws_sns_topic.test.arn,
40+
aws_sns_topic.main.arn,
4541
]
4642

4743
sid = "AllowAllSNSActionsFromAccount"
@@ -57,7 +53,7 @@ data "aws_iam_policy_document" "sns_topic_policy" {
5753
variable = "AWS:SourceArn"
5854

5955
values = [
60-
"arn:aws:sns:${var.region}:${var.shared_infra_account_id}:nhs-*-core-to-supplier-events",
56+
"arn:aws:iam::${var.shared_infra_account_id}:role/nhs-*-core-to-supplier-events",
6157
]
6258
}
6359

@@ -69,7 +65,7 @@ data "aws_iam_policy_document" "sns_topic_policy" {
6965
}
7066

7167
resources = [
72-
aws_sns_topic.test.arn,
68+
aws_sns_topic.main.arn,
7369
]
7470

7571
sid = "AllowAllSNSActionsFromSharedAccount"

0 commit comments

Comments
 (0)