-
Notifications
You must be signed in to change notification settings - Fork 1
/
locals.tf
66 lines (64 loc) · 1.87 KB
/
locals.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
locals {
argocd_enabled = length(var.argocd) > 0 ? 1 : 0
namespace = var.namespace
}
locals {
vpc_id = var.vpc_id
repository = "https://aws.github.io/eks-charts"
name = "alb"
chart = "aws-load-balancer-controller"
chart_version = var.chart_version
conf = merge(local.conf_defaults, var.conf)
conf_defaults = {
"resources.limits.cpu" = "100m",
"resources.limits.memory" = "128Mi",
"resources.requests.cpu" = "50m",
"resources.requests.memory" = "64Mi",
"region" = data.aws_region.current.name
"serviceAccount.create" = false,
"serviceAccount.name" = local.name,
"clusterName" = data.aws_eks_cluster.this.name,
"ingressClass" = "alb",
"disableIngressClassAnnotation" = false,
"createIngressClassResource" = true,
"vpcId" = local.vpc_id
}
application = {
"apiVersion" = "argoproj.io/v1alpha1"
"kind" = "Application"
"metadata" = {
"name" = local.name
"namespace" = var.argocd.namespace
}
"spec" = {
"destination" = {
"namespace" = local.namespace
"server" = "https://kubernetes.default.svc"
}
"project" = "default"
"source" = {
"repoURL" = local.repository
"targetRevision" = local.chart_version
"chart" = local.chart
"helm" = {
"parameters" = values({
for key, value in local.conf :
key => {
"name" = key
"value" = tostring(value)
}
})
}
}
"syncPolicy" = {
"automated" = {
"prune" = true
"selfHeal" = true
}
"syncOptions" = {
"createNamespace" = true
}
}
}
}
}