-
Notifications
You must be signed in to change notification settings - Fork 0
/
iam.tf
executable file
·33 lines (29 loc) · 854 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
resource "aws_iam_role" "export_pi_metrics_role" {
name = "export_pi_metrics_role"
}
resource "aws_iam_role_policy" "export_pi_metrics_policy" {
name = "export_pi_metrics_policy"
role = aws_iam_role.export_pi_metrics_role.name
policy = <<-EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"pi:GetResourceMetrics"
],
"Effect": "Allow",
"Resource": "arn:aws:pi:*:*:metrics/rds/*"
}
]
}
EOF
}
resource "aws_iam_role_policy_attachment" "cw_full_access" {
role = aws_iam_role.export_pi_metrics_role.name
policy_arn = "arn:aws:iam::aws:policy/CloudWatchFullAccess"
}
resource "aws_iam_role_policy_attachment" "rds_read_only_access" {
role = aws_iam_role.export_pi_metrics_role.name
policy_arn = "arn:aws:iam::aws:policy/AmazonRDSReadOnlyAccess"
}