-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathvariables.tf
206 lines (155 loc) · 4.86 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
variable "AWS_REGION" {}
variable "AWS_ACCESS_KEY_ID" {}
variable "AWS_SECRET_ACCESS_KEY" {}
variable "SCALING_DESIRED_CAPACITY" {
default = 2
}
variable "CLUSTER_NAME" {
default = "istio"
}
variable "cluster_version" {
default = "1.18"
description = "Version of the kubernetes cluster"
}
variable "enable_irsa" {
description = "Whether to create OpenID Connect Provider for EKS to enable IRSA"
type = bool
default = true
}
locals {
availabilityzone = "${var.AWS_REGION}a"
availabilityzone2 = "${var.AWS_REGION}b"
cluster_name = var.CLUSTER_NAME
// NOTE: The usage of the specific kubernetes.io/cluster/*
// resource tags below are required for EKS and Kubernetes to discover
// and manage networking resources.
common_tags = {
"Environment" = var.CLUSTER_NAME
"kubernetes.io/cluster/${local.cluster_name}" = "shared"
}
ec2_principal = "ec2.${data.aws_partition.current.dns_suffix}"
sts_principal = "sts.${data.aws_partition.current.dns_suffix}"
oidc_provider_arn = var.enable_irsa ? concat(aws_iam_openid_connect_provider.oidc_provider[*].arn, [""])[0] : null
cluster_oidc_issuer_url = flatten(concat(aws_eks_cluster.eks-cluster.identity[*].oidc.0.issuer, [""]))[0]
}
variable "vpc_cidr" {
description = "CIDR for the whole VPC"
default = "10.11.0.0/16"
}
// Primary pair of public/private networks
variable "use_simple_vpc" {
default = true
type = bool
description = ""
}
variable "public_subnet_cidr" {
description = "CIDR for the Public Subnet"
default = "10.11.0.0/24"
}
variable "private_subnet_cidr" {
description = "CIDR for the Private Subnet"
default = "10.11.1.0/24"
}
// Secondary pair of public/private networks (if you ever needed that)
variable "public_subnet_cidr2" {
description = "CIDR for the Public Subnet"
default = "10.11.2.0/24"
}
variable "private_subnet_cidr2" {
description = "CIDR for the Private Subnet"
default = "10.11.3.0/24"
}
variable "eks_oidc_root_ca_thumbprint" {
type = string
description = "Thumbprint of Root CA for EKS OIDC, Valid until 2037"
default = "9e99a48a9960b14926bb7f3b02e22da2b0ab7280"
}
# ingress
variable "option_alb_ingress_enabled" {
default = false
}
variable "ingress_alb_helm_chart_name" {
type = string
default = "aws-load-balancer-controller"
}
variable "ingress_alb_helm_chart_version" {
type = string
default = "1.0.3"
}
variable "ingress_alb_helm_release_name" {
type = string
default = "aws-load-balancer-controller"
}
variable "ingress_alb_helm_repo_url" {
type = string
default = "https://aws.github.io/eks-charts"
}
variable "ingress_alb_k8s_namespace" {
type = string
# kube-system is recommended over alb-ingress
# per https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html
default = "kube-system"
description = "The k8s namespace in which the alb-ingress service account has been created"
}
variable "ingress_alb_k8s_service_account_name" {
type = string
default = "aws-load-balancer-controller"
description = "The k8s alb-ingress service account name, should match to helm chart expectations"
}
variable "ingress_alb_k8s_dummy_dependency" {
default = null
description = "TODO: eliminate allows dirty re-drop"
}
variable "ingress_alb_settings" {
type = map(any)
default = {}
description = "Additional settings for Helm chart check https://artifacthub.io/packages/helm/helm-incubator/aws-alb-ingress-controller"
}
# /ingress
# external dns
variable "option_external_dns_enabled" {
default = false
type = bool
}
variable "external_dns_helm_chart_name" {
type = string
default = "external-dns"
}
variable "external_dns_helm_chart_version" {
type = string
default = "3.5.1"
}
variable "external_dns_helm_release_name" {
type = string
default = "external-dns"
}
variable "external_dns_helm_repo_url" {
type = string
default = "https://charts.bitnami.com/bitnami"
}
variable "external_dns_k8s_namespace" {
type = string
default = "kube-system"
description = "The k8s namespace in which the alb-ingress service account has been created"
}
variable "external_dns_k8s_service_account_name" {
type = string
default = "external-dns"
description = "The k8s external-dns service account name, ideally should match to helm chart expectations"
}
variable "external_dns_settings" {
type = map(any)
default = {}
description = "Additional settings for external-dns helm chart check https://github.com/bitnami/charts/tree/master/bitnami/external-dns"
}
# /external dns
# Application specific variables
variable "domain" {
default = ""
}
variable "namespaces" {
type = list(string)
description = "List of namespaces to be created in our EKS Cluster."
default = []
}
# /Application specific variables