File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -23,3 +23,32 @@ resource "aws_sqs_queue_redrive_allow_policy" "id_sync_queue_redrive_allow_polic
2323 sourceQueueArns = [aws_sqs_queue.id_sync_queue.arn]
2424 })
2525}
26+
27+ # IAM policy.
28+ # TODO: this is currently a global allow policy.
29+ # Refine this to allow receive from our lambda, and send from MNS
30+
31+ data "aws_iam_policy_document" "id_sync_sqs_policy" {
32+ statement {
33+ sid = " id-sync-queue SQS statement"
34+ effect = " Allow"
35+
36+ principals {
37+ type = " AWS"
38+ identifiers = [" *" ]
39+ }
40+
41+ actions = [
42+ " sqs:SendMessage" ,
43+ " sqs:ReceiveMessage"
44+ ]
45+ resources = [
46+ aws_sqs_queue . id_sync_queue . arn
47+ ]
48+ }
49+ }
50+
51+ resource "aws_sqs_queue_policy" "id_sync_sqs_policy" {
52+ queue_url = aws_sqs_queue. id_sync_queue . id
53+ policy = data. aws_iam_policy_document . id_sync_sqs_policy . json
54+ }
You can’t perform that action at this time.
0 commit comments