-
Notifications
You must be signed in to change notification settings - Fork 68
/
variables.tf
213 lines (181 loc) · 5.45 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
207
208
209
210
211
212
213
variable "name" {
description = "Nodepool name"
type = string
}
variable "vpc_id" {
description = "VPC ID to create resources in"
type = string
}
variable "subnets" {
description = "List of subnet IDs to create resources in"
type = list(string)
}
variable "instance_type" {
description = "Node pool instance type"
default = "t3.medium"
}
variable "ami" {
description = "Node pool ami"
type = string
default = ""
}
variable "tags" {
description = "Map of additional tags to add to all resources created"
type = map(string)
default = {}
}
#
# Nodepool Variables
#
variable "iam_instance_profile" {
description = "Node pool IAM Instance Profile, created if left blank (default behavior)"
type = string
default = ""
}
variable "iam_permissions_boundary" {
description = "If provided, the IAM role created for the nodepool will be created with this permissions boundary attached."
type = string
default = null
}
variable "ssh_authorized_keys" {
description = "Node pool list of public keys to add as authorized ssh keys, not required"
type = list(string)
default = []
}
variable "block_device_mappings" {
description = "Node pool block device mapping configuration"
type = map(string)
default = {
"size" = 30
type = "gp2"
}
}
variable "extra_cloud_config_config" {
description = "extra config to append to cloud-config"
type = string
default = ""
}
variable "extra_block_device_mappings" {
description = "Used to specify additional block device mapping configurations"
type = list(map(string))
default = [
]
}
variable "asg" {
description = "Node pool AutoScalingGroup scaling definition"
type = object({
min = number
max = number
desired = number
suspended_processes = optional(list(string))
termination_policies = optional(list(string))
})
default = {
min = 1
max = 10
desired = 1
suspended_processes = []
termination_policies = ["Default"]
}
}
variable "spot" {
description = "Toggle spot requests for node pool"
type = bool
default = false
}
variable "extra_security_group_ids" {
description = "List of additional security group IDs"
type = list(string)
default = []
}
variable "metadata_options" {
type = map(any)
default = {
http_endpoint = "enabled"
http_tokens = "required" # IMDS-v2
http_put_response_hop_limit = 2 # allow pods to use IMDS as well
instance_metadata_tags = "disabled"
}
description = "Instance Metadata Options"
}
#
# RKE2 Variables
#
variable "cluster_data" {
description = "Required data relevant to joining an existing rke2 cluster, sourced from main rke2 module, do NOT modify"
type = object({
name = string
server_url = string
cluster_sg = string
token = object({
bucket = string
bucket_arn = string
object = string
policy_document = string
})
})
}
variable "rke2_version" {
description = "Version to use for RKE2 server nodepool"
type = string
default = "v1.19.7+rke2r1"
}
variable "rke2_config" {
description = "Node pool additional configuration passed as rke2 config file, see https://docs.rke2.io/install/install_options/agent_config for full list of options"
default = ""
}
variable "enable_ccm" {
description = "Toggle enabling the cluster as aws aware, this will ensure the appropriate IAM policies are present"
type = bool
default = false
}
variable "enable_autoscaler" {
description = "Toggle configure the nodepool for cluster autoscaler, this will ensure the appropriate IAM policies are present, you are still responsible for ensuring cluster autoscaler is installed"
type = bool
default = false
}
variable "download" {
description = "Toggle best effort download of rke2 dependencies (rke2 and aws cli), if disabled, dependencies are assumed to exist in $PATH"
type = bool
default = true
}
variable "pre_userdata" {
description = "Custom userdata to run immediately before rke2 node attempts to join cluster, after required rke2, dependencies are installed"
type = string
default = ""
}
variable "post_userdata" {
description = "Custom userdata to run immediately after rke2 node attempts to join cluster"
type = string
default = ""
}
variable "wait_for_capacity_timeout" {
description = "How long Terraform should wait for ASG instances to be healthy before timing out."
type = string
default = "10m"
}
variable "ccm_external" {
description = "Set kubelet arg 'cloud-provider-name' value to 'external'. Requires manual install of CCM."
type = bool
default = false
}
variable "rke2_start" {
description = "Start/Stop value for the rke2-server/agent service. True=start, False= don't start."
type = bool
default = true
}
variable "rke2_install_script_url" {
description = "URL for RKE2 install script"
type = string
default = "https://get.rke2.io"
}
variable "awscli_url" {
description = "URL for awscli zip file"
type = string
default = "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"
}
variable "unzip_rpm_url" {
description = "URL path to unzip rpm"
type = string
default = ""
}