-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathroute53resourcechange_policy.tf
81 lines (67 loc) · 2.09 KB
/
route53resourcechange_policy.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# ------------------------------------------------------------------------------
# Create the IAM policy that allows all of the route53 actions necessary to create and
# modify resource records in the cyber.dhs.gov zone.
# ------------------------------------------------------------------------------
data "aws_iam_policy_document" "route53resourcechange_doc" {
statement {
actions = [
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListResourceRecordSets",
]
resources = ["arn:aws:route53:::hostedzone/${aws_route53_zone.cyber_dhs_gov.id}"]
}
statement {
actions = [
"route53:GetChange"
]
resources = ["arn:aws:route53:::change/*"]
}
statement {
actions = [
"route53:ListHostedZones"
]
resources = ["*"]
}
statement {
actions = [
"ses:DeleteIdentity",
"ses:GetAccount",
"ses:GetIdentityDkimAttributes",
"ses:GetIdentityMailFromDomainAttributes",
"ses:GetIdentityNotificationAttributes",
"ses:GetIdentityVerificationAttributes",
"ses:PutAccountVdmAttributes",
"ses:SetIdentityHeadersInNotificationsEnabled",
"ses:SetIdentityMailFromDomain",
"ses:SetIdentityNotificationTopic",
"ses:VerifyDomainDkim",
"ses:VerifyDomainIdentity",
]
resources = ["*"]
}
statement {
actions = [
"sns:*",
]
resources = [
"arn:aws:sns:${var.aws_region}:${local.dns_account_id}:cyber_dhs_gov_bounce",
"arn:aws:sns:${var.aws_region}:${local.dns_account_id}:cyber_dhs_gov_complaint",
"arn:aws:sns:${var.aws_region}:${local.dns_account_id}:cyber_dhs_gov_delivery",
]
}
statement {
actions = [
"sqs:*",
]
resources = [
"arn:aws:sqs:${var.aws_region}:${local.dns_account_id}:cyber_dhs_gov_delivery",
]
}
}
resource "aws_iam_policy" "route53resourcechange_policy" {
provider = aws.dnsprovisionaccount
description = var.route53resourcechange_role_description
name = var.route53resourcechange_role_name
policy = data.aws_iam_policy_document.route53resourcechange_doc.json
}