-
Notifications
You must be signed in to change notification settings - Fork 0
/
iam.tf
87 lines (84 loc) · 2.08 KB
/
iam.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
82
83
84
85
86
87
data "aws_iam_policy_document" "tunnel" {
statement {
actions = [
"ec2:*",
"tag:GetResources",
]
resources = ["*"]
}
statement {
actions = [
"kms:ListKeys",
"kms:ListAliases",
"kms:Get*",
"kms:GenerateDataKey*",
"kms:Encrypt",
"kms:Describe*",
"kms:Decrypt",
]
resources = ["*"]
}
statement {
effect = "Allow"
actions = [
"cloudwatch:UntagResource",
"cloudwatch:ListTagsForResource",
"cloudwatch:TagResource",
"cloudwatch:PutDashboard",
"cloudwatch:ListDashboards",
"cloudwatch:DeleteDashboards",
"cloudwatch:GetDashboard",
"cloudwatch:ListMetrics",
"cloudwatch:PutMetricData",
"cloudwatch:GetMetricData",
"cloudwatch:DeleteInsightRules",
"cloudwatch:DeleteAnomalyDetector",
"cloudwatch:StartMetricStreams",
"cloudwatch:DescribeAnomalyDetectors",
"cloudwatch:StopMetricStreams",
"cloudwatch:DeleteMetricStream",
"cloudwatch:PutAnomalyDetector",
"cloudwatch:GetMetricWidgetImage",
"cloudwatch:DescribeInsightRules",
"cloudwatch:GetInsightRuleReport",
"cloudwatch:DisableInsightRules",
"cloudwatch:EnableInsightRules",
"cloudwatch:GetMetricStatistics",
"cloudwatch:PutMetricStream",
"cloudwatch:PutInsightRule",
"cloudwatch:ListMetricStreams",
"cloudwatch:DescribeAlarms",
"cloudwatch:GetMetricStream"
]
resources = ["*"]
}
statement {
effect = "Allow"
actions = [
"ssm:*"
]
resources = ["*"]
}
statement {
effect = "Allow"
actions = [
"route53:ListHostedZones",
"route53:GetChange",
"route53:ChangeResourceRecordSets"
]
resources = ["*"]
}
}
module "tunnel_role" {
source = "./modules/tf-module-iam-role/"
role_name = "tunnel"
policy = data.aws_iam_policy_document.tunnel.json
trusted_identifier = {
type = "Service"
identifiers = ["ec2.amazonaws.com"]
}
}
resource "aws_iam_instance_profile" "tunnel" {
name = "tunnel"
role = module.tunnel_role.role.name
}