-
Notifications
You must be signed in to change notification settings - Fork 0
/
outputs.tf
73 lines (70 loc) · 1.87 KB
/
outputs.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
locals {
versions = {
"1.23.1" = "<1.24.0"
"1.24.3" = "<1.25.0"
"1.25.3" = "<1.26.0"
"1.26.8" = "<1.27.0"
"1.27.8" = "<1.28.0"
"1.28.6" = "<1.29.0"
"1.29.4" = "<1.30.0"
"1.30.2" = ">=1.30.0"
}
}
output "addons" {
value = [
for asTag, k8sVersion in local.versions :
{
content = templatefile("${path.module}/addon_content.tpl", {
image_tag = asTag
replicas = var.replicas
cluster_name = var.cluster_name
})
kubernetes_version = k8sVersion
version = asTag
name = "cluster-autoscaler"
}
]
}
output "permissions" {
value = [
{
name = "cluster-autoscaler"
namespace = "kube-system"
aws = {
inline_policy = jsonencode(
[
{
Action = [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeScalingActivities",
"autoscaling:DescribeTags",
"ec2:DescribeInstanceTypes",
"ec2:DescribeLaunchTemplateVersions"
],
Effect = "Allow"
Resource = "*"
},
{
Action = [
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup",
"ec2:DescribeImages",
"ec2:GetInstanceTypesFromInstanceRequirements",
"eks:DescribeNodegroup"
]
Condition = {
"StringEquals" : {
"aws:ResourceTag/KubernetesCluster" : var.cluster_name
}
}
Effect = "Allow"
Resource = "*"
}
]
)
}
}
]
}