Skip to content

Commit 9fe62c0

Browse files
committed
Terraform fixes
1 parent e564ec1 commit 9fe62c0

2 files changed

Lines changed: 15 additions & 28 deletions

File tree

infrastructure/terraform/components/api/module_lambda_allocation.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ module "allocation_lambda" {
4040
}
4141
}
4242

43+
4344
data "aws_iam_policy_document" "allocation_lambda" {
4445
statement {
4546
sid = "KMSPermissions"
@@ -54,4 +55,18 @@ data "aws_iam_policy_document" "allocation_lambda" {
5455
module.kms.key_arn,
5556
]
5657
}
58+
59+
statement {
60+
sid = "AllowQueueAccess"
61+
effect = "Allow"
62+
63+
actions = [
64+
"sqs:SendMessage",
65+
"sqs:GetQueueAttributes",
66+
]
67+
68+
resources = [
69+
module.amendments_queue.sqs_queue_arn
70+
]
71+
}
5772
}

infrastructure/terraform/components/api/module_sqs_amendments_queue.tf

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,3 @@ module "amendments_queue" {
1818
create_dlq = true
1919
sqs_policy_overload = data.aws_iam_policy_document.amendments_queue_policy.json
2020
}
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_event_bus.arn, module.eventsub.sns_topic_supplier.arn]
45-
46-
}
47-
}
48-
}

0 commit comments

Comments
 (0)