-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathvariables.tf
More file actions
executable file
·279 lines (233 loc) · 8.12 KB
/
variables.tf
File metadata and controls
executable file
·279 lines (233 loc) · 8.12 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
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
//********************** Basic Configuration Variables **************************//
variable "single_gateway_name" {
description = "Single gateway name"
type = string
}
variable "resource_group_name" {
description = "Azure Resource Group name to build into"
type = string
}
variable "location" {
description = "The location/region where resource will be created. The full list of Azure regions can be found at https://azure.microsoft.com/regions"
type = string
}
//********************** Virtual Machine Instances Variables **************************//
variable "source_image_vhd_uri" {
type = string
description = "The URI of the blob containing the development image. Please use noCustomUri if you want to use marketplace images."
default = "noCustomUri"
}
variable "admin_username" {
description = "Administrator username of deployed VM. Due to Azure limitations 'notused' name can be used"
default = "notused"
}
variable "admin_password" {
description = "Administrator password of deployed Virtual Machine. The password must meet the complexity requirements of Azure"
type = string
}
variable "serial_console_password_hash" {
description = "Optional parameter, used to enable serial console connection in case of SSH key as authentication type"
type = string
default = ""
}
variable "maintenance_mode_password_hash" {
description = "Maintenance mode password hash, relevant only for R81.20 and higher versions"
type = string
default = ""
}
variable "smart_1_cloud_token" {
description = "Smart-1 Cloud Token"
type = string
}
variable "authentication_type" {
description = "Specifies whether a password authentication or SSH Public Key authentication should be used"
type = string
}
locals { // locals for 'authentication_type' allowed values
authentication_type_allowed_values = [
"Password",
"SSH Public Key"
]
// will fail if [var.authentication_type] is invalid:
validate_authentication_type_value = index(local.authentication_type_allowed_values, var.authentication_type)
}
variable "installation_type" {
description = "Installation type"
type = string
default = "gateway"
}
locals { // locals for 'installation_type' allowed values
installation_type_allowed_values = [
"gateway",
"standalone"
]
}
variable "vm_size" {
description = "Specifies size of Virtual Machine"
type = string
}
variable "disk_size" {
description = "Storage data disk size size(GB). Select a number between 100 and 3995"
type = string
}
variable "os_version" {
description = "GAIA OS version"
type = string
}
locals { // locals for 'vm_os_offer' allowed values
os_version_allowed_values = [
"R8110",
"R8120",
"R82"
]
// will fail if [var.os_version] is invalid:
validate_os_version_value = index(local.os_version_allowed_values, var.os_version)
}
variable "vm_os_sku" {
description = "The sku of the image to be deployed."
type = string
}
variable "vm_os_offer" {
description = "The name of the image offer to be deployed.Choose from: check-point-cg-r8110, check-point-cg-r8120, check-point-cg-r82"
type = string
}
locals { // locals for 'vm_os_offer' allowed values
vm_os_offer_allowed_values = [
"check-point-cg-r8110",
"check-point-cg-r8120",
"check-point-cg-r82"
]
// will fail if [var.vm_os_offer] is invalid:
validate_os_offer_value = index(local.vm_os_offer_allowed_values, var.vm_os_offer)
}
variable "allow_upload_download" {
description = "Automatically download Blade Contracts and other important data. Improve product experience by sending data to Check Point"
type = bool
}
variable "enable_custom_metrics" {
description = "Indicates whether CloudGuard Metrics will be use for Cluster members monitoring."
type = bool
default = true
}
variable "is_blink" {
description = "Define if blink image is used for deployment"
default = true
}
variable "admin_shell" {
description = "The admin shell to configure on machine or the first time"
type = string
default = "/etc/cli.sh"
}
locals {
admin_shell_allowed_values = [
"/etc/cli.sh",
"/bin/bash",
"/bin/csh",
"/bin/tcsh"
]
// Will fail if [var.admin_shell] is invalid
validate_admin_shell_value = index(local.admin_shell_allowed_values, var.admin_shell)
}
//********************** Networking Variables **************************//
variable "vnet_name" {
description = "Virtual Network name"
type = string
}
variable "subnet_frontend_name" {
description = "management subnet name"
type = string
}
variable "subnet_backend_name" {
description = "management subnet name"
type = string
}
variable "subnet_frontend_1st_Address" {
description = "The first available address of the frontend subnet"
type = string
}
variable "subnet_backend_1st_Address" {
description = "The first available address of the backend subnet"
type = string
}
variable "vnet_resource_group" {
description = "Resource group of existing vnet"
type = string
}
variable "vnet_allocation_method" {
description = "IP address allocation method"
type = string
default = "Static"
}
variable "management_GUI_client_network" {
description = "Allowed GUI clients - GUI clients network CIDR"
type = string
}
locals {
regex_valid_single_GUI_client_network = "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$"
// Will fail if var.management_GUI_client_network is invalid
regex_single_GUI_client_network = regex(local.regex_valid_single_GUI_client_network, var.management_GUI_client_network) == var.management_GUI_client_network ? 0 : "Variable [management_GUI_client_network] must be a valid IPv4 network CIDR."
regex_valid_subnet_1st_Address = "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
// Will fail if var.subnet_1st_Address is invalid
regex_subnet_frontend_1st_Address = regex(local.regex_valid_subnet_1st_Address, var.subnet_frontend_1st_Address) == var.subnet_frontend_1st_Address ? 0 : "Variable [subnet_1st_Address] must be a valid address."
regex_subnet_backend_1st_Address = regex(local.regex_valid_subnet_1st_Address, var.subnet_backend_1st_Address) == var.subnet_backend_1st_Address ? 0 : "Variable [subnet_1st_Address] must be a valid address."
}
variable "bootstrap_script" {
description = "An optional script to run on the initial boot"
default = ""
type = string
#example:
#"touch /home/admin/bootstrap.txt; echo 'hello_world' > /home/admin/bootstrap.txt"
}
variable "nsg_id" {
description = "NSG ID - Optional - if empty use default NSG"
default = ""
}
variable "add_storage_account_ip_rules" {
type = bool
default = false
description = "Add Storage Account IP rules that allow access to the Serial Console only for IPs based on their geographic location"
}
variable "storage_account_additional_ips" {
type = list(string)
description = "IPs/CIDRs that are allowed access to the Storage Account"
default = []
}
variable "sic_key" {
type = string
}
resource "null_resource" "sic_key_invalid" {
count = length(var.sic_key) >= 12 ? 0 : "SIC key must be at least 12 characters long"
}
variable "sku" {
description = "SKU"
type = string
default = "Standard"
}
variable "admin_SSH_key" {
type = string
description = "(Optional) TheUsed when the authentication_type is 'SSH Public Key'. The SSH public key for SSH authentication to the template instances."
default = ""
}
variable "security_rules" {
description = "Security rules for the Network Security Group using this format [name, priority, direction, access, protocol, source_source_port_rangesport_range, destination_port_ranges, source_address_prefix, destination_address_prefix, description]"
type = list(any)
default = [
{
name = "AllowAllInBound"
priority = "100"
direction = "Inbound"
access = "Allow"
protocol = "*"
source_port_ranges = "*"
destination_port_ranges = ""
description = "Allow all inbound connections"
source_address_prefix = "*"
destination_address_prefix = ""
}
]
}
variable "tags" {
description = "Assign tags by resource."
type = map(map(string))
default = {}
}