-
Notifications
You must be signed in to change notification settings - Fork 0
/
policies.tf
62 lines (54 loc) · 1.26 KB
/
policies.tf
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
resource "aws_sqs_queue_policy" "mo" {
queue_url = aws_sqs_queue.mo.id
policy = data.aws_iam_policy_document.mo.json
}
data "aws_iam_policy_document" "mo" {
statement {
principals {
type = "AWS"
identifiers = [local.rock7_arn]
}
actions = [
"sqs:SendMessage",
"sqs:GetQueueUrl"
]
resources = [aws_sqs_queue.mo.arn]
}
}
resource "aws_sqs_queue_policy" "mt" {
queue_url = aws_sqs_queue.mt.id
policy = data.aws_iam_policy_document.mt.json
}
data "aws_iam_policy_document" "mt" {
statement {
principals {
type = "AWS"
identifiers = [local.rock7_arn]
}
actions = [
"sqs:ReceiveMessage",
"sqs:ChangeMessageVisibility",
"sqs:DeleteMessage",
"sqs:GetQueueAttributes",
"sqs:GetQueueUrl"
]
resources = [aws_sqs_queue.mt.arn]
}
}
resource "aws_sqs_queue_policy" "mt_confirm" {
queue_url = aws_sqs_queue.mt_confirm.id
policy = data.aws_iam_policy_document.mt_confirm.json
}
data "aws_iam_policy_document" "mt_confirm" {
statement {
principals {
type = "AWS"
identifiers = [local.rock7_arn]
}
actions = [
"sqs:SendMessage",
"sqs:GetQueueUrl"
]
resources = [aws_sqs_queue.mt_confirm.arn]
}
}