-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
191 lines (161 loc) · 5.67 KB
/
variables.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
variable "environment" {
description = "The name of the stage."
type = string
}
variable "project" {
description = "Project name."
type = string
}
variable "subnet_ids" {
description = "A list of subnet IDs where the nodes/node groups will be provisioned. If `control_plane_subnet_ids` is not provided, the EKS cluster control plane (ENIs) will be provisioned in these subnets"
type = list(string)
}
variable "cluster_version" {
description = "Kubernetes `<major>.<minor>` version to use for the EKS cluster (i.e.: `1.24`)"
type = string
}
variable "eks_managed_node_groups" {
description = "Map of EKS managed node group definitions to create. https://github.com/terraform-aws-modules/terraform-aws-eks/tree/master/modules/eks-managed-node-group"
type = any
}
variable "eks_managed_node_group_defaults" {
description = "Map of EKS managed node group default configurations"
type = any
}
variable "manage_aws_auth_configmap" {
description = "Determines whether to manage the aws-auth configmap"
type = bool
default = true
}
variable "aws_auth_roles" {
description = "List of role maps to add to the aws-auth configmap"
type = list(any)
default = []
}
variable "aws_auth_users" {
description = "List of user maps to add to the aws-auth configmap"
type = list(any)
default = []
}
variable "node_security_group_additional_rules" {
description = "List of additional security group rules to add to the node security group created. Set `source_cluster_security_group = true` inside rules to set the `cluster_security_group` as source"
type = any
default = {}
}
variable "cloudwatch_log_group_retention_in_days" {
description = "Number of days to retain log events. Default retention - 90 days"
type = number
default = 90
}
variable "cluster_endpoint_public_access" {
description = "Indicates whether or not the Amazon EKS public API server endpoint is enabled"
type = bool
default = false
}
variable "cluster_endpoint_public_access_cidrs" {
description = "List of CIDR blocks which can access the Amazon EKS public API server endpoint"
type = list(string)
default = ["0.0.0.0/0"]
}
variable "use_case" {
description = "The use case of the Kubernetes cluster. Used in in the cluster name."
type = string
default = "k8s"
}
variable "cluster_enabled_log_types" {
description = "A list of the desired control plane logs to enable. For more information, see Amazon EKS Control Plane Logging documentation (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html)"
type = list(string)
default = ["api", "authenticator", "audit", "scheduler", "controllerManager"]
}
variable "cluster_addons" {
description = "EKS and K8s addons to enable."
type = map(bool)
default = {
enable_amazon_eks_aws_ebs_csi_driver = true
enable_amazon_eks_coredns = true
enable_amazon_eks_kube_proxy = true
enable_amazon_eks_vpc_cni = true
enable_aws_load_balancer_controller = true
enable_cluster_autoscaler = true
enable_metrics_server = true
enable_external_dns = true
}
}
variable "aws_load_balancer_controller_helm_config" {
description = "AWS Load Balancer Controller Helm Chart config"
type = any
default = {}
}
variable "cluster_autoscaler_helm_config" {
description = "Cluster Autoscaler Helm Chart config"
type = any
default = {}
}
variable "metrics_server_helm_config" {
description = "Metrics Server Helm Chart config"
type = any
default = {}
}
variable "amazon_eks_vpc_cni_config" {
description = "EKS VPC CNI config"
type = any
default = {}
}
variable "amazon_eks_kube_proxy_config" {
description = "EKS Kube-Proxy config"
type = any
default = {}
}
variable "amazon_eks_coredns_config" {
description = "External DNS Helm Chart config"
type = any
default = {}
}
variable "amazon_eks_aws_ebs_csi_driver_config" {
description = "EKS EBS CSI config"
type = any
default = {}
}
variable "external_dns_helm_config" {
description = "External DNS Helm Chart config"
type = any
default = {}
}
variable "external_dns_route53_zone_arns" {
description = "List of Route53 zones ARNs which external-dns will have access to create/manage records"
type = list(string)
default = []
}
variable "external_dns_route53_zone_id" {
description = "Route53 zone id for the hosted zone used to for the EKS cluster."
type = string
default = null
}
variable "eks_cluster_domain" {
description = "The domain for the EKS cluster"
type = string
default = ""
}
variable "enable_argocd" {
description = "Enable and manage Kubernetes addons by ArgoCD."
type = bool
default = false
}
variable "argocd_helm_config" {
description = "Configuration for the ArgoCD Helm chart."
type = any
default = {}
}
locals {
cluster_name = "${local.prefix}-${var.use_case}"
prefix_env = terraform.workspace == "default" ? var.environment : terraform.workspace
prefix = "${var.project}-${local.prefix_env}"
enable_external_dns = lookup(var.cluster_addons, "enable_external_dns", true) && var.eks_cluster_domain != "" && length(var.external_dns_route53_zone_arns) > 0 && var.external_dns_route53_zone_id != null
argocd_applications = var.enable_argocd ? {
addons = {
path = "chart"
repo_url = "https://github.com/aws-samples/eks-blueprints-add-ons.git"
add_on_application = true
}
} : {}
}