forked from pippiio/aws-eks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
44 lines (39 loc) · 1018 Bytes
/
main.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
data "aws_ssm_parameters_by_path" "k8s_secrets" {
path = "/kubernetes"
recursive = true
}
data "aws_iam_session_context" "current" {
arn = data.aws_caller_identity.current.arn
}
locals {
config = defaults(var.config, {
cluster_version = "1.22"
api_allowed_ips = "0.0.0.0/0"
efs_enabled = false
ssh_enabled = false
ssh_security_groups = ""
})
fixed_addons = [
"vpc-cni",
"coredns",
"kube-proxy",
]
addons = concat(local.config.addons, local.fixed_addons)
nlb_ports = {
http = {
listen = 80,
target = 31080,
},
https = {
listen = 443,
target = 31443,
},
}
k8s_secrets = {
for name in data.aws_ssm_parameters_by_path.k8s_secrets.names : name => {
secret_name = split("/", name)[3]
secret_namespace = split("/", name)[2]
secret_value = data.aws_ssm_parameters_by_path.k8s_secrets.values[index(data.aws_ssm_parameters_by_path.k8s_secrets.names, name)]
}
}
}