-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
182 lines (152 loc) · 5.32 KB
/
variables.tf
File metadata and controls
182 lines (152 loc) · 5.32 KB
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
# Required
variable "aws_region" {
description = "AWS Region."
type = string
}
variable "kubernetes_version" {
description = "The version of the EKS cluster to create."
type = string
}
variable "env" {
description = "Deployment environment."
type = string
}
variable "module_prefix" {
description = "String to prefix resource names."
type = string
}
variable "vpc_id" {
description = "VPC ID where the EKS cluster will be created."
type = string
}
# Optional
variable "arn_format" {
type = string
default = "aws"
description = "ARNs identifier, useful for GovCloud begin with `aws-us-gov-<region>`."
}
variable "aws_public_hosted_zone" {
description = "Public Hosted zone subdomain."
type = string
default = null
}
variable "aws_private_hosted_zone" {
description = "Private Hosted zone subdomain."
type = string
default = null
}
variable "node_group_instance_sizes" {
description = "Node group instance sizes as a list of strings."
type = list(string)
default = ["t3.xlarge"]
}
variable "private_subnet_ids" {
description = "Private subnet IDs to add kubernetes cluster on."
type = list(string)
default = []
}
variable "public_subnet_ids" {
description = "Publlic subnet IDs to add kubernetes cluster on."
type = list(string)
default = []
}
variable "allowed_cidr_blocks" {
description = "List of cidr to allow inbound traffic to the EKS cluster."
type = list(string)
default = []
}
variable "allowed_management_cidr_blocks" {
description = "List of cidr to allow inbound traffic to the EKS management API."
type = list(string)
default = []
}
variable "eks_aws_auth_configmap_enable" {
description = "Determines whether to manage the aws-auth configmap"
type = bool
default = false
}
variable "eks_aws_auth_configmap_roles" {
description = "List of role maps to add to the EKS cluster aws-auth configmap, require eks_aws_auth_configmap_enable to be true"
type = list(any)
default = []
}
variable "eks_aws_auth_configmap_users" {
description = "List of user maps to add to the EKS cluster aws-auth configmap, require eks_aws_auth_configmap_enable to be true"
type = list(any)
default = []
}
variable "eks_managed_node_groups_options" {
description = "An object variable containing key-value pairs for the eks_managed_node_groups parameters."
type = object({
min_size = number
max_size = number
desired_size = number
})
default = {
min_size = 3
max_size = 5
desired_size = 3
}
}
variable "create_logs_bucket" {
description = "Flag to create an S3 bucket or not."
type = bool
default = false
}
variable "load_balancer_account_id" {
description = <<EOF
Load Balancer account ID for the given region you deployed your load balancer in based on this list:
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/enable-access-logging.html#attach-bucket-policy.
EOF
type = string
default = "797873946194"
}
variable "addon_ebs_csi_driver" {
description = "Install Amazon EBS CSI driver add-on. Require for EKS cluster version 1.23 and above. For content, refer to 'aws_eks_addon' Terraform resource."
type = map(string)
default = {}
}
variable "addon_eks_pod_identity_agent" {
description = "Install AWS EKS Pod Identity Agent on the EKS cluster. Require Kubernetes version 1.24 and above. For content, refer to 'aws_eks_addon' Terraform resource."
type = map(string)
default = {}
}
variable "addon_vpc_cni_driver" {
description = "Install Amazon VPC CNI driver add-on. Require for EKS cluster version 1.25 and above. For content, refer to 'aws_eks_addon' Terraform resource."
type = map(string)
default = {}
}
variable "addon_coredns_driver" {
description = "Install Core DNS driver add-on. Require for EKS cluster version 1.25 and above. For content, refer to 'aws_eks_addon' Terraform resource."
type = map(string)
default = {}
}
variable "addon_kube_proxy_driver" {
description = "Install Kube Proxy driver add-on. Require for EKS cluster version 1.25 and above. For content, refer to 'aws_eks_addon' Terraform resource."
type = map(string)
default = {}
}
# https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1904
variable "cluster_iam_role_dns_suffix" {
description = "Base DNS domain name for the current partition (e.g., amazonaws.com in AWS Commercial, amazonaws.com.cn in AWS China)"
type = string
default = null
}
variable "overwrite_image_variables" {
description = "A map of objects containing key-value pairs to overwrite the default image variables - registry, repository and tag. Each key-value is optional. The default value is used if omit."
# Example:
# custom_container_images = {
# external-dns = {
# registry = "public.ecr.aws"
# repository = "external-dns"
# tag = "0.15.0-debian-12-r2"
# }
# }
type = map(any)
default = {}
}
locals {
eks_cluster_name = "${var.module_prefix}-cluster"
public_hosted_zone_id = var.aws_public_hosted_zone == null ? "" : var.aws_public_hosted_zone
private_hosted_zone_id = var.aws_private_hosted_zone == null ? "" : var.aws_private_hosted_zone
}