-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathiam.tf
37 lines (35 loc) · 820 Bytes
/
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
resource "aws_iam_policy" "cloudwatch_read_access" {
name = "cloudwatch_read_access"
description = "cloudwatch_read_access"
path = "/"
policy = <<POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:Describe*",
"cloudwatch:Describe*",
"cloudwatch:Get*",
"cloudwatch:List*",
"logs:Get*",
"logs:Describe*",
"logs:TestMetricFilter",
"sns:Get*",
"sns:List*"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
POLICY
}
resource "aws_iam_user" "monitor_fluentd_cloudwatch" {
name = "monitor_fluentd_cloudwatch"
}
resource "aws_iam_policy_attachment" "cloudwatch_read_access_attach" {
name = "cloudwatch_read_access_attach"
users = ["${aws_iam_user.monitor_fluentd_cloudwatch.name}"]
policy_arn = "${aws_iam_policy.cloudwatch_read_access.arn}"
}