-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
352 lines (301 loc) · 9.29 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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# ##################################################
# # Azure and IBM Authentication Variables
# ##################################################
variable "ibm_resource_group" {
description = "Resource group name of the IBM Cloud account."
type = string
default = "default"
}
variable "az_resource_group" {
description = "Name of the resource Group"
type = string
default = "satellite-azure"
}
variable "is_az_resource_group_exist" {
description = "If false, resource group (az_resource_group) will be created. If true, existing resource group (az_resource_group) will be read"
type = bool
default = true
}
variable "az_region" {
description = "Azure Region"
type = string
default = "eastus"
}
# ##################################################
# # Azure Resources Variables
# ##################################################
variable "az_resource_prefix" {
description = "Name to be used on all azure resources as prefix"
type = string
default = "satellite-azure"
}
variable "ssh_public_key" {
description = "SSH Public Key. Get your ssh key by running `ssh-key-gen` command"
type = string
default = null
}
variable "satellite_host_count" {
description = "The total number of Azure host to create for control plane. "
type = number
default = 3
validation {
condition = (var.satellite_host_count % 3) == 0 && var.satellite_host_count > 0
error_message = "Sorry, host_count value should always be in multiples of 3, such as 6, 9, or 12 hosts."
}
}
variable "addl_host_count" {
description = "The total number of additional azure vm's"
type = number
default = 0
}
variable "az_source_address_prefix" {
description = "Azure security group source address prefix"
type = list(string)
default = ["*"]
}
variable "az_security_custom_rules" {
description = "Azure security group custom rules"
type = list(object({
name = string
priority = number
direction = string
access = string
protocol = string
source_port_range = string
destination_port_range = string
source_address_prefix = string
destination_address_prefix = string
description = string
}))
default = [
{
name = "ssh"
priority = 110
direction = "Inbound"
access = "Allow"
protocol = "tcp"
source_port_range = "*"
destination_port_range = "22"
source_address_prefix = "*"
destination_address_prefix = "*"
description = "description-myssh"
},
{
name = "satellite"
priority = 100
direction = "Inbound"
access = "Allow"
protocol = "*"
source_port_range = "*"
destination_port_range = "80,443,30000-32767"
source_address_prefix = "*"
destination_address_prefix = "*"
description = "description-http"
},
]
}
variable "azure_vnet_address_space" {
description = "Azure vNet address space"
type = list(string)
default = ["10.0.0.0/16"]
}
variable "azure_vnet_subnet_prefixes" {
description = "Azure vNet subnet prefixes"
type = list(string)
default = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
}
variable "az_cp_vm_os_disk" {
description = "Azure control plane vm os disk"
type = object({
caching = string
storage_account_type = string
disk_size_gb = number
})
default = {
caching = "ReadWrite"
storage_account_type = "Premium_LRS"
disk_size_gb = 128
}
}
variable "az_cp_vm_source_image_reference" {
description = "Azure control plane vm source image reference"
type = object({
publisher = string
offer = string
sku = string
version = string
})
default = {
publisher = "RedHat"
offer = "RHEL"
sku = "7-LVM"
version = "latest"
}
}
variable "az_cluster_vm_os_disk" {
description = "Azure cluster vm os disk"
type = object({
caching = string
storage_account_type = string
disk_size_gb = number
})
default = {
caching = "ReadWrite"
storage_account_type = "Premium_LRS"
disk_size_gb = 128
}
}
variable "az_cluster_vm_source_image_reference" {
description = "Azure host source image reference"
type = object({
publisher = string
offer = string
sku = string
version = string
})
default = {
publisher = "RedHat"
offer = "RHEL"
sku = "7-LVM"
version = "latest"
}
}
variable "location_instance_type" {
description = "The type of azure instance to create"
type = string
default = "Standard_D4s_v3"
}
variable "cluster_instance_type" {
description = "The type of azure instance to create"
type = string
default = "Standard_D4s_v3"
}
# ##################################################
# # IBMCLOUD Satellite Location Variables
# ##################################################
variable "location" {
description = "Location Name"
default = "satellite-azure"
validation {
condition = var.location != "" && length(var.location) <= 32
error_message = "Sorry, please provide value for location_name variable or check the length of name it should be less than 32 chars."
}
}
variable "is_location_exist" {
description = "Determines if the location has to be created or not"
type = bool
default = false
}
variable "managed_from" {
description = "The IBM Cloud region to manage your Satellite location from. Choose a region close to your on-prem data center for better performance."
type = string
default = "wdc"
}
variable "location_zones" {
description = "Allocate your hosts across these three zones"
type = list(string)
default = ["eastus-1", "eastus-2", "eastus-3"]
}
variable "location_bucket" {
description = "COS bucket name"
default = ""
}
variable "host_labels" {
description = "Labels to add to attach host script"
type = list(string)
default = ["env:prod"]
validation {
condition = can([for s in var.host_labels : regex("^[a-zA-Z0-9:]+$", s)])
error_message = "Label must be of the form `key:value`."
}
}
##################################################
# IBMCLOUD ROKS Cluster Variables
##################################################
variable "create_cluster" {
description = "Create Cluster"
type = bool
default = false
}
variable "cluster" {
description = "Cluster name"
type = string
default = "satellite-ibm-cluster"
validation {
error_message = "Cluster name must begin and end with a letter and contain only letters, numbers, and - characters."
condition = can(regex("^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", var.cluster))
}
}
variable "kube_version" {
description = "Satellite Kube Version"
}
variable "cluster_host_labels" {
description = "Labels to add to attach host script"
type = list(string)
default = ["env:prod"]
validation {
condition = can([for s in var.cluster_host_labels : regex("^[a-zA-Z0-9:]+$", s)])
error_message = "Label must be of the form `key:value`."
}
}
variable "worker_count" {
description = "Worker Count for default pool"
type = number
default = 1
}
variable "wait_for_worker_update" {
description = "Wait for worker update"
type = bool
default = true
}
variable "default_worker_pool_labels" {
description = "Label to add default worker pool"
type = map(any)
default = null
}
variable "tags" {
description = "List of tags associated with cluster."
type = list(string)
default = null
}
variable "create_timeout" {
type = string
description = "Timeout duration for create."
default = null
}
variable "update_timeout" {
type = string
description = "Timeout duration for update."
default = null
}
variable "delete_timeout" {
type = string
description = "Timeout duration for delete."
default = null
}
##################################################
# IBMCLOUD ROKS Cluster Worker Pool Variables
##################################################
variable "create_cluster_worker_pool" {
description = "Create Cluster worker pool"
type = bool
default = false
}
variable "worker_pool_name" {
description = "Satellite Location Name"
type = string
default = "satellite-worker-pool"
validation {
error_message = "Cluster name must begin and end with a letter and contain only letters, numbers, and - characters."
condition = can(regex("^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", var.worker_pool_name))
}
}
variable "worker_pool_host_labels" {
description = "Labels to add to attach host script"
type = list(string)
default = ["env:prod"]
validation {
condition = can([for s in var.worker_pool_host_labels : regex("^[a-zA-Z0-9:]+$", s)])
error_message = "Label must be of the form `key:value`."
}
}