-
Notifications
You must be signed in to change notification settings - Fork 11
/
data.tf
58 lines (45 loc) · 972 Bytes
/
data.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
data "aws_partition" "current" {}
data "aws_iam_policy_document" "sns_policy" {
count = var.enable_sns_notifications ? 1 : 0
statement {
sid = "AllowSNSPublish"
actions = [
"SNS:Publish",
]
effect = "Allow"
principals {
type = "Service"
identifiers = [
"backup.amazonaws.com"
]
}
resources = var.create_sns_topic ? [aws_sns_topic.main[0].arn] : [var.sns_topic_arn]
}
}
data "aws_iam_policy_document" "main" {
statement {
sid = "AllowBackupService"
actions = [
"sts:AssumeRole",
]
effect = "Allow"
principals {
type = "Service"
identifiers = [
"backup.amazonaws.com"
]
}
}
}
data "aws_iam_policy_document" "main_custom_policy" {
statement {
sid = "AllowTaggingResources"
actions = [
"backup:TagResource",
"backup:ListTags",
"backup:UntagResource",
"tag:GetResources"
]
resources = ["*"]
}
}