forked from rancherfederal/rke2-aws-tf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
244 lines (206 loc) · 6.16 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
variable "cluster_name" {
description = "Name of the rkegov cluster to create"
type = string
}
variable "unique_suffix" {
description = "Enables/disables generation of a unique suffix to cluster name"
type = bool
default = true
}
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 "tags" {
description = "Map of tags to add to all resources created"
default = {}
type = map(string)
}
#
# Server pool variables
#
variable "instance_type" {
type = string
default = "t3a.medium"
description = "Server pool instance type"
}
variable "ami" {
description = "Server pool ami"
type = string
}
variable "iam_instance_profile" {
description = "Server 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 servers will be created with this permissions boundary attached."
type = string
default = null
}
variable "block_device_mappings" {
description = "Server pool block device mapping configuration"
type = map(string)
default = {
"size" = 30
"encrypted" = false
}
}
variable "extra_block_device_mappings" {
description = "Used to specify additional block device mapping configurations"
type = list(map(string))
default = [
]
}
variable "extra_security_group_ids" {
description = "List of additional security group IDs"
type = list(string)
default = []
}
variable "servers" {
description = "Number of servers to create"
type = number
default = 3
}
variable "spot" {
description = "Toggle spot requests for server pool"
type = bool
default = false
}
variable "ssh_authorized_keys" {
description = "Server pool list of public keys to add as authorized ssh keys"
type = list(string)
default = []
}
variable "suspended_processes" {
description = "List of processes to suspend in the autoscaling service"
type = list(string)
default = []
}
variable "termination_policies" {
description = "List of policies to decide how the instances in the Auto Scaling Group should be terminated"
type = list(string)
default = ["Default"]
}
#
# Controlplane Variables
#
variable "controlplane_enable_cross_zone_load_balancing" {
description = "Toggle between controlplane cross zone load balancing"
default = true
type = bool
}
variable "controlplane_internal" {
description = "Toggle between public or private control plane load balancer"
default = true
type = bool
}
variable "controlplane_allowed_cidrs" {
description = "Server pool security group allowed cidr ranges"
type = list(string)
default = ["0.0.0.0/0"]
}
variable "controlplane_access_logs_bucket" {
description = "Bucket name for logging requests to control plane load balancer"
type = string
default = "disabled"
}
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 "rke2_version" {
description = "Version to use for RKE2 server nodes"
type = string
default = "v1.19.7+rke2r1"
}
variable "rke2_config" {
description = "Server pool additional configuration passed as rke2 config file, see https://docs.rke2.io/install/install_options/server_config for full list of options"
type = string
default = ""
}
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 "enable_ccm" {
description = "Toggle enabling the cluster as aws aware, this will ensure the appropriate IAM policies are present"
type = bool
default = false
}
variable "ccm_external" {
description = "Set kubelet arg 'cloud-provider-name' value to 'external'. Requires manual install of CCM."
type = bool
default = false
}
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 "associate_public_ip_address" {
default = false
type = bool
}
variable "extra_cloud_config_config" {
description = "extra config to append to cloud-config"
type = string
default = ""
}
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 = ""
}
variable "rke2_start" {
description = "Start/Stop value for the rke2-server/agent service. This will prevent the service from starting until the next reboot. True=start, False= don't start."
type = bool
default = true
}
#
### Statestore Variables
#
variable "statestore_attach_deny_insecure_transport_policy" {
description = "Toggle for enabling s3 policy to reject non-SSL requests"
type = bool
default = true
}
variable "create_acl" {
description = "Toggle creation of ACL for statestore bucket"
type = bool
default = true
}