Skip to content

Commit 8c2408f

Browse files
committed
Add permissions
1 parent 2c16f82 commit 8c2408f

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

infrastructure/terraform/components/api/module_sqs_amendments_queue.tf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,32 @@ module "amendments_queue" {
1616
visibility_timeout_seconds = 60
1717

1818
create_dlq = true
19+
sqs_policy_overload = data.aws_iam_policy_document.amendments_queue_policy.json
20+
}
21+
22+
data "aws_iam_policy_document" "amendments_queue_policy" {
23+
version = "2012-10-17"
24+
statement {
25+
sid = "AllowSNSToSendMessage"
26+
effect = "Allow"
27+
28+
principals {
29+
type = "Service"
30+
identifiers = ["sns.amazonaws.com"]
31+
}
32+
33+
actions = [
34+
"sqs:SendMessage"
35+
]
36+
37+
resources = [
38+
"arn:aws:sqs:${var.region}:${var.aws_account_id}:${local.csi}-amendments-queue.fifo"
39+
]
40+
41+
condition {
42+
test = "ArnEquals"
43+
variable = "aws:SourceArn"
44+
values = [module.eventsub.sns_topic_supplier.arn]
45+
}
46+
}
1947
}

0 commit comments

Comments
 (0)