forked from vantage-sh/ec2instances.info
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iam.tf
34 lines (32 loc) · 793 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
resource "aws_iam_user" "pricing" {
force_destroy = false
name = "pricing"
path = "/"
}
resource "aws_iam_user_policy_attachment" "pricing" {
user = aws_iam_user.pricing.name
policy_arn = aws_iam_policy.ec2_pricing.arn
}
resource "aws_iam_policy" "ec2_pricing" {
name = "ec2_pricing"
description = "allow access to ec2 instance types and pricing information"
path = "/"
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Action = [
"ec2:DescribeInstanceTypes",
"ec2:DescribeRegions",
"pricing:*",
"elasticache:DescribeEngineDefaultParameters"
],
Resource = "*"
}
]
})
tags = {
Terraformed = "true"
}
}