-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsqs_test_publish_mns.tf
More file actions
33 lines (27 loc) · 919 Bytes
/
sqs_test_publish_mns.tf
File metadata and controls
33 lines (27 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Main queue for MNS notification testing
resource "aws_sqs_queue" "mns_test_notification" {
name = "${var.mns_test_notifcation_name_prefix}-queue"
fifo_queue = false
kms_master_key_id = aws_kms_key.mns_outbound_events.arn
visibility_timeout_seconds = 300
}
data "aws_iam_policy_document" "mns_test_notification_sqs_policy" {
statement {
sid = "mns-test-notification-allow-lambda-access"
effect = "Allow"
principals {
type = "AWS"
identifiers = [aws_iam_role.mns_publisher_lambda_exec_role.arn]
}
actions = [
"sqs:SendMessage",
]
resources = [
aws_sqs_queue.mns_test_notification.arn
]
}
}
resource "aws_sqs_queue_policy" "mns_test_notification_sqs" {
queue_url = aws_sqs_queue.mns_test_notification.id
policy = data.aws_iam_policy_document.mns_test_notification_sqs_policy.json
}