-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathdata.tf
More file actions
51 lines (47 loc) · 1.51 KB
/
data.tf
File metadata and controls
51 lines (47 loc) · 1.51 KB
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
# Required IAM policy for AWS CCM (https://cloud-provider-aws.sigs.k8s.io/prerequisites/#iam-policies)
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"
]
}
}
# Required IAM policy for AWS Cluster Autoscaler
# (https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#full-cluster-autoscaler-features-policy-recommended)
data "aws_iam_policy_document" "aws_autoscaler" {
count = var.enable_autoscaler ? 1 : 0
statement {
actions = [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeScalingActivities",
"ec2:DescribeImages",
"ec2:DescribeInstanceTypes",
"ec2:DescribeLaunchTemplateVersions",
"ec2:GetInstanceTypesFromInstanceRequirements",
"eks:DescribeNodegroup"
]
effect = "Allow"
resources = ["*"]
}
statement {
actions = [
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup"
]
effect = "Allow"
resources = ["*"]
}
}