-
Notifications
You must be signed in to change notification settings - Fork 67
/
data.tf
55 lines (51 loc) · 1.52 KB
/
data.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
# Required IAM Policy for AWS CCM
data "aws_iam_policy_document" "aws_ccm" {
count = var.iam_instance_profile == "" && var.enable_ccm ? 1 : 0
statement {
effect = "Allow"
resources = ["*"]
actions = [
"ec2:DescribeInstances",
"ec2:DescribeRegions",
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:GetRepositoryPolicy",
"ecr:DescribeRepositories",
"ecr:ListImages",
"ecr:BatchGetImage",
"autoscaling:DescribeTags",
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
]
}
}
# Required IAM Policy for AWS Cluster Autoscaler
data "aws_iam_policy_document" "aws_autoscaler" {
count = var.iam_instance_profile == "" && var.enable_autoscaler ? 1 : 0
statement {
effect = "Allow"
resources = ["*"]
actions = [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeScalingActivities",
"autoscaling:DescribeTags",
"ec2:DescribeInstanceTypes",
"ec2:DescribeLaunchTemplateVersions"
]
}
statement {
effect = "Allow"
resources = ["*"]
actions = [
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup",
"ec2:DescribeImages",
"ec2:GetInstanceTypesFromInstanceRequirements",
"eks:DescribeNodegroup"
]
}
}