-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
577 lines (496 loc) · 26.6 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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
############################################################
# The variables and data sources used in VPC infra Modules.
############################################################
variable "PRIVATE_SSH_KEY" {
type = string
description = "id_rsa private key content in OpenSSH format (Sensitive value). This private key should be used only during the terraform provisioning and it is recommended to be changed after the SAP deployment."
nullable = false
validation {
condition = length(var.PRIVATE_SSH_KEY) >= 64 && var.PRIVATE_SSH_KEY != null && length(var.PRIVATE_SSH_KEY) != 0 || contains(["n.a"], var.PRIVATE_SSH_KEY )
error_message = "The content for private_ssh_key variable must be in OpenSSH format."
}
}
variable "ID_RSA_FILE_PATH" {
default = "ansible/id_rsa"
nullable = false
description = "File path for PRIVATE_SSH_KEY. It will be automatically generated. If it is changed, it must contain the relative path from git repo folders. Example: ansible/id_rsa_s4hana_ha"
}
variable "SSH_KEYS" {
type = list(string)
description = "List of SSH Keys UUIDs that are allowed to connect via SSH, as root, to the VSI. Can contain one or more IDs. The list of SSH Keys is available here: https://cloud.ibm.com/vpc-ext/compute/sshKeys."
validation {
condition = var.SSH_KEYS == [] ? false : true && var.SSH_KEYS == [""] ? false : true
error_message = "At least one SSH KEY is needed to be able to access the VSI."
}
}
variable "BASTION_FLOATING_IP" {
type = string
description = "The BASTION FLOATING IP. It can be found at the end of the Bastion Server deployment log, in \"Outputs\", before \"Command finished successfully\" message. "
nullable = false
validation {
condition = can(regex("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$",var.BASTION_FLOATING_IP)) || contains(["localhost"], var.BASTION_FLOATING_IP ) && var.BASTION_FLOATING_IP!= null
error_message = "Incorrect format for variable: BASTION_FLOATING_IP."
}
}
variable "RESOURCE_GROUP" {
type = string
description = "The name of an EXISTING Resource Group. The list of Resource Groups is available here: https://cloud.ibm.com/account/resource-groups"
default = "Default"
}
variable "REGION" {
type = string
description = "The cloud region where to deploy the solution. The regions and zones for VPC are available here: https://cloud.ibm.com/docs/containers?topic=containers-regions-and-zones#zones-vpc. Supported locations in IBM Cloud Schematics: https://cloud.ibm.com/docs/schematics?topic=schematics-locations."
validation {
condition = contains(["eu-de", "eu-gb", "us-south", "us-east", "ca-tor", "au-syd", "jp-osa", "jp-tok", "eu-es", "br-sao"], var.REGION )
error_message = "The REGION must be one of: eu-de, eu-gb, us-south, us-east, ca-tor, au-syd, jp-osa, jp-tok, eu-es, br-sao."
}
}
variable "VPC" {
type = string
description = "The name of an EXISTING VPC. Must be in the same region as the solution to be deployed. The list of VPCs is available here: https://cloud.ibm.com/vpc-ext/network/vpcs."
validation {
condition = length(regexall("^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$", var.VPC)) > 0
error_message = "The VPC name is not valid."
}
}
variable "ZONE_1" {
type = string
description = "Availability zone for DB_HOSTNAME_1 and APP_HOSTNAME_1 VSIs, in the same VPC. Supported zones: https://cloud.ibm.com/docs/containers?topic=containers-regions-and-zones#zones-vpc"
validation {
condition = length(regexall("^(eu-de|eu-gb|us-south|us-east|ca-tor|au-syd|jp-osa|jp-tok|eu-es|br-sao)-(1|2|3)$", var.ZONE_1)) > 0
error_message = "The ZONE is not valid."
}
}
variable "SUBNET_1" {
type = string
description = "The name of an EXISTING Subnet, in the same VPC, ZONE_1, where DB_HOSTNAME_1 and APP_HOSTNAME_1 VSIs will be created. The list of Subnets is available here: https://cloud.ibm.com/vpc-ext/network/subnets"
validation {
condition = length(regexall("^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$", var.SUBNET_1)) > 0
error_message = "The SUBNET name is not valid."
}
}
variable "ZONE_2" {
type = string
description = "Availability zone for DB_HOSTNAME_2 and APP_HOSTNAME_2 VSIs, in the same VPC. Supported zones: https://cloud.ibm.com/docs/containers?topic=containers-regions-and-zones#zones-vpc. If the same value as for ZONE_1 is used, and the value for SUBNET_1 is the same with the value for SUBNET_2, the deployment will be done in a single zone. If the values for ZONE_1, SUBNET_1 are different than the ones for ZONE_2, SUBNET_2 then an SAP Multizone deployment will be done."
validation {
condition = length(regexall("^(eu-de|eu-gb|us-south|us-east|ca-tor|au-syd|jp-osa|jp-tok|eu-es|br-sao)-(1|2|3)$", var.ZONE_2)) > 0
error_message = "The ZONE is not valid."
}
}
variable "SUBNET_2" {
type = string
description = "The name of an EXISTING Subnet, in the same VPC, ZONE_2, where DB_HOSTNAME_2 and APP_HOSTNAME_2 VSIs will be created. The list of Subnets is available here: https://cloud.ibm.com/vpc-ext/network/subnets. If the same value as for SUBNET_1 is used, and the value for ZONE_1 is the same with the value for ZONE_2, the deployment will be done in a single zone. If the values for ZONE_1, SUBNET_1 are different than the ones for ZONE_2, SUBNET_2 then it an SAP Multizone deployment will be done."
validation {
condition = length(regexall("^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$", var.SUBNET_2)) > 0
error_message = "The SUBNET name is not valid."
}
}
variable "SECURITY_GROUP" {
type = string
description = "The name of an EXISTING Security group for the same VPC. It can be found at the end of the Bastion Server deployment log, in \"Outputs\", before \"Command finished successfully\" message. The list of Security Groups is available here: https://cloud.ibm.com/vpc-ext/network/securityGroups."
validation {
condition = length(regexall("^([a-z]|[a-z][-a-z0-9]*[a-z0-9]|[0-9][-a-z0-9]*([a-z]|[-a-z][-a-z0-9]*[a-z0-9]))$", var.SECURITY_GROUP)) > 0
error_message = "The SECURITY_GROUP name is not valid."
}
}
variable "DOMAIN_NAME" {
type = string
description = "The Domain Name used for DNS and ALB. Duplicates are not allowed. The list with DNS resources can be found here: https://cloud.ibm.com/resources."
nullable = false
default = "ha.mzexample.com"
validation {
condition = length(var.DOMAIN_NAME) > 2 && length (regex("^[a-z]*||^[0-9]*||\\.||\\-", var.DOMAIN_NAME)) > 0 && length (regex("[\\.]", var.DOMAIN_NAME)) > 0 && length (regexall("[\\&]|[\\%]|[\\!]|[\\@]|[\\#]|[\\*]|[\\^]", var.DOMAIN_NAME)) == 0
error_message = "The DOMAIN_NAME variable should not be empty and must contain at least one \".\" as a separator and no special chars are allowed."
}
}
locals {
ASCS_VIRT_HOSTNAME = "sap${var.SAP_SID}ascs"
ERS_VIRT_HOSTNAME = "sap${var.SAP_SID}ers"
HANA_VIRT_HOSTNAME = "db${var.HANA_SID}hana"
}
variable "ASCS_VIRT_HOSTNAME" {
type = string
description = "ASCS Virtual hostname. Obs: When the default value is used, the virtual hostname will automatically be changed based on <SAP_SID> to \"sap<sap_sid>ascs\"."
nullable = false
default = "sapascs"
validation {
condition = length(var.ASCS_VIRT_HOSTNAME) > 2 && length (regex("^[a-z]*||^[0-9]*", var.ASCS_VIRT_HOSTNAME)) > 0 && length (regexall("[\\&]|[\\%]|[\\!]|[\\@]|[\\#]|[\\*]|[\\^]", var.ASCS_VIRT_HOSTNAME)) == 0
error_message = "The ASCS_VIRT_HOSTNAME variable should not be empty and no special chars are allowed."
}
}
output VIRT_HOSTNAME_ASCS {
value = var.ASCS_VIRT_HOSTNAME != "sapascs" ? var.ASCS_VIRT_HOSTNAME : lower ("${local.ASCS_VIRT_HOSTNAME}")
}
variable "ERS_VIRT_HOSTNAME" {
type = string
description = "ERS Virtual hostname. Obs: When the default value is used, the virtual hostname will automatically be changed based on <SAP_SID> to \"sap<sap_sid>ers\""
nullable = false
default = "sapers"
validation {
condition = length(var.ERS_VIRT_HOSTNAME) > 2 && length (regex("^[a-z]*||^[0-9]*", var.ERS_VIRT_HOSTNAME)) > 0 && length (regexall("[\\&]|[\\%]|[\\!]|[\\@]|[\\#]|[\\*]|[\\^]", var.ERS_VIRT_HOSTNAME)) == 0
error_message = "The ERS_VIRT_HOSTNAME variable should not be empty and no special chars are allowed."
}
}
output VIRT_HOSTNAME_ERS {
value = var.ERS_VIRT_HOSTNAME != "sapers" ? var.ERS_VIRT_HOSTNAME : lower ("${local.ERS_VIRT_HOSTNAME}")
}
variable "HANA_VIRT_HOSTNAME" {
type = string
description = "HANA Virtual hostname. Obs: When the default value is used, the virtual hostname will automatically be changed based on <HANA_SID> to \"db<hana_sid>hana\""
nullable = false
default = "dbhana"
validation {
condition = length(var.HANA_VIRT_HOSTNAME) > 2 && length (regex("^[a-z]*||^[0-9]*", var.HANA_VIRT_HOSTNAME)) > 0 && length (regexall("[\\&]|[\\%]|[\\!]|[\\@]|[\\#]|[\\*]|[\\^]", var.HANA_VIRT_HOSTNAME)) == 0
error_message = "The HANA_VIRT_HOSTNAME variable should not be empty and no special chars are allowed."
}
}
output VIRT_HOSTNAME_HANA {
value = var.HANA_VIRT_HOSTNAME != "dbhana" ? var.HANA_VIRT_HOSTNAME : lower ("${local.HANA_VIRT_HOSTNAME}")
}
locals {
DB_HOSTNAME_1 = "hanadb-${var.HANA_SID}-1"
DB_HOSTNAME_2 = "hanadb-${var.HANA_SID}-2"
APP_HOSTNAME_1 = "sapapp-${var.SAP_SID}-1"
APP_HOSTNAME_2 = "sapapp-${var.SAP_SID}-2"
}
variable "DB_PROFILE" {
type = string
description = "DB VSI Profile. The certified profiles for SAP HANA in IBM VPC: https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-intel-vs-vpc"
default = "mx2-16x128"
validation {
condition = contains(keys(jsondecode(file("files/hana_volume_layout.json")).profiles), "${var.DB_PROFILE}")
error_message = "The chosen storage PROFILE for HANA VSI \"${var.DB_PROFILE}\" is not a certified storage profile. Please, chose the appropriate certified storage PROFILE for the HANA VSI from https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-intel-vs-vpc . Make sure the selected PROFILE is certified for the selected OS type and for the proceesing type (SAP Business One, OLTP, OLAP)"
}
}
variable "DB_IMAGE" {
type = string
description = "The OS image for the HANA VSI. You must use the Red Hat Enterprise Linux 8 for SAP HANA (amd64) image for all VMs as this image contains the required SAP and HA subscriptions. A list of images is available here: https://cloud.ibm.com/docs/vpc?topic=vpc-about-images."
default = "ibm-redhat-8-6-amd64-sap-hana-6"
}
variable "DB_HOSTNAME_1" {
type = string
description = "HANA DB VSI HOSTNAME 1 in SAP HANA Cluster. The hostname should be up to 13 characters. Obs: When the default value is used, the virtual hostname will automatically be changed based on <HANA_SID> to \"hanadb-<hana_sid>-1\""
default = "hanadb-1"
validation {
condition = length(var.DB_HOSTNAME_1) <= 13 && length(regexall("^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$", var.DB_HOSTNAME_1)) > 0
error_message = "The DB_HOSTNAME is not valid."
}
}
output HANA_DB_HOSTNAME_VSI1 {
value = var.DB_HOSTNAME_1 != "hanadb-1" ? var.DB_HOSTNAME_1 : lower ("${local.DB_HOSTNAME_1}")
}
variable "DB_HOSTNAME_2" {
type = string
description = "HANA DB VSI HOSTNAME 2 in SAP HANA Cluster. The hostname should be up to 13 characters. Obs: When the default value is used, the virtual hostname will automatically be changed based on <HANA_SID> to \"hanadb-<hana_sid>-2\""
default = "hanadb-2"
nullable = true
validation {
condition = length(var.DB_HOSTNAME_2) <= 13 && length(regexall("^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$", var.DB_HOSTNAME_2)) > 0
error_message = "The DB_HOSTNAME is not valid."
}
}
output HANA_DB_HOSTNAME_VSI2 {
value = var.DB_HOSTNAME_2 != "hanadb-2" ? var.DB_HOSTNAME_2 : lower ("${local.DB_HOSTNAME_2}")
}
variable "APP_PROFILE" {
type = string
description = "The profile for the APP VSI. A list of profiles is available here: https://cloud.ibm.com/docs/vpc?topic=vpc-profiles. For more information, check SAP Note 2927211: \"SAP Applications on IBM Virtual Private Cloud\"."
default = "bx2-4x16"
}
variable "APP_IMAGE" {
type = string
description = "The OS image for the APP VSI. You must use the Red Hat Enterprise Linux 8 for SAP HANA (amd64) image for all VMs as this image contains the required SAP and HA subscriptions. A list of images is available here: https://cloud.ibm.com/docs/vpc?topic=vpc-about-images."
default = "ibm-redhat-8-6-amd64-sap-hana-6"
}
variable "APP_HOSTNAME_1" {
type = string
description = "APP VSI HOSTNAME 1 in SAP APP Cluster. The hostname should be up to 13 characters. Obs: When the default value is used, the virtual hostname will automatically be changed based on <SAP_SID> to \"sapapp-<sap_sid>-1\""
default = "sapapp-1"
validation {
condition = length(var.APP_HOSTNAME_1) <= 13 && length(regexall("^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$", var.APP_HOSTNAME_1)) > 0
error_message = "The APP_HOSTNAME is not valid."
}
}
output SAP_APP_HOSTNAME_VSI1 {
value = var.APP_HOSTNAME_1 != "sapapp-1" ? var.APP_HOSTNAME_1 : lower ("${local.APP_HOSTNAME_1}")
}
variable "APP_HOSTNAME_2" {
type = string
description = "APP VSI HOSTNAME 2 in SAP APP Cluster. The hostname should be up to 13 characters. Obs: When the default value is used, the virtual hostname will automatically be changed based on <SAP_SID> to \"sapapp-<sap_sid>-2\""
default = "sapapp-2"
nullable = true
validation {
condition = length(var.APP_HOSTNAME_2) <= 13 && length(regexall("^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$", var.APP_HOSTNAME_2)) > 0
error_message = "The APP_HOSTNAME is not valid."
}
}
output SAP_APP_HOSTNAME_VSI2 {
value = var.APP_HOSTNAME_2 != "sapapp-2" ? var.APP_HOSTNAME_2 : lower ("${local.APP_HOSTNAME_2}")
}
locals {
SAP-ALB-ASCS = "sap-alb-ascs"
SAP-ALB-ERS = "sap-alb-ers"
DB-ALB-HANA = "db-alb-hana"
}
data "ibm_is_lb" "alb-ascs" {
depends_on = [module.alb-prereq]
name = lower ("${local.SAP-ALB-ASCS}-${var.SAP_SID}")
}
data "ibm_is_lb" "alb-ers" {
depends_on = [module.alb-prereq]
name = lower ("${local.SAP-ALB-ERS}-${var.SAP_SID}")
}
data "ibm_is_lb" "alb-hana" {
depends_on = [module.alb-prereq]
name = lower ("${local.DB-ALB-HANA}-${var.HANA_SID}")
}
data "ibm_is_instance" "app-vsi-1" {
depends_on = [module.app-vsi]
name = var.APP_HOSTNAME_1 != "sapapp-1" ? var.APP_HOSTNAME_1 : lower ("${local.APP_HOSTNAME_1}")
}
data "ibm_is_instance" "app-vsi-2" {
depends_on = [module.app-vsi]
name = var.APP_HOSTNAME_2 != "sapapp-2" ? var.APP_HOSTNAME_2 : lower ("${local.APP_HOSTNAME_2}")
}
data "ibm_is_instance" "db-vsi-1" {
depends_on = [module.db-vsi]
name = var.DB_HOSTNAME_1 != "hanadb-1" ? var.DB_HOSTNAME_1 : lower ("${local.DB_HOSTNAME_1}")
}
data "ibm_is_instance" "db-vsi-2" {
depends_on = [module.db-vsi]
name = var.DB_HOSTNAME_2 != "hanadb-2" ? var.DB_HOSTNAME_2 : lower ("${local.DB_HOSTNAME_2}")
}
############################################################
# The variables and data sources used in File_Share Module.
############################################################
data "ibm_is_vpc" "vpc" {
name = var.VPC
}
data "ibm_resource_group" "group" {
name = var.RESOURCE_GROUP
}
data "ibm_is_subnet" "subnet_id" {
name = var.SUBNET_1
}
data "ibm_is_security_group" "security_group_id" {
name = var.SECURITY_GROUP
}
variable "SHARE_PROFILE" {
description = "The Storage Profile for the File Share. For more details see: https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles&interface=ui#dp2-profile."
type = string
default = "dp2"
}
variable "USRSAP_AS1" {
description = "File Share Size for USRSAP_AS1, in GB"
type = number
default = 20
}
variable "USRSAP_AS2" {
description = "File Share Size for USRSAP_AS2, in GB"
type = number
default = 20
}
variable "USRSAP_SAPASCS" {
description = "File Share Size for USRSAP_SAPASCS, in GB"
type = number
default = 20
}
variable "USRSAP_SAPERS" {
description = "File Share Size for USRSAP_SAPERS, in GB"
type = number
default = 20
}
variable "USRSAP_SAPMNT" {
description = "File Share Size for USRSAP_SAPMNT, in GB"
type = number
default = 20
}
variable "USRSAP_SAPSYS" {
description = "File Share Size for USRSAP_SAPSYS, in GB"
type = number
default = 20
}
variable "USRSAP_TRANS" {
description = "File Share Size for USRSAP_TRANS, in GB"
type = number
default = 80
}
##############################################################
# The variables and data sources used in SAP Ansible Modules.
##############################################################
variable "S4HANA_VERSION" {
type = string
description = "The version of S/4HANA. Supported values: 2023, 2022, 2021, 2020."
default = "2023"
validation {
condition = contains(["2023", "2022", "2021", "2020"], var.S4HANA_VERSION)
error_message = "The version of S/4HANA is not supported. The value of S4HANA_VERSION should be one of the following: 2023, 2022, 2021, 2020"
}
}
variable "HANA_SID" {
type = string
description = "The SAP system ID identifies the SAP HANA system. Consists of three alphanumeric characters and the first character must be a letter. Does not include any of the reserved IDs listed in SAP Note 1979280"
default = "HDB"
validation {
condition = length(regexall("^[a-zA-Z][a-zA-Z0-9][a-zA-Z0-9]$", var.HANA_SID)) > 0 && !contains(["ADD", "ALL", "AMD", "AND", "ANY", "ARE", "ASC", "AUX", "AVG", "BIT", "CDC", "COM", "CON", "DBA", "END", "EPS", "FOR", "GET", "GID", "IBM", "INT", "KEY", "LOG", "LPT", "MAP", "MAX", "MIN", "MON", "NIX", "NOT", "NUL", "OFF", "OLD", "OMS", "OUT", "PAD", "PRN", "RAW", "REF", "ROW", "SAP", "SET", "SGA", "SHG", "SID", "SQL", "SUM", "SYS", "TMP", "TOP", "UID", "USE", "USR", "VAR"], var.HANA_SID)
error_message = "The HANA_SID is not valid."
}
}
variable "SAP_ASCS_INSTANCE_NUMBER" {
type = string
description = "The central ABAP service instance number. Technical identifier for internal processes of ASCS. Consists of a two-digit number from 00 to 97. Must be unique on a host. Must follow the SAP rules for instance number naming."
default = "00"
validation {
condition = var.SAP_ASCS_INSTANCE_NUMBER >= 0 && var.SAP_ASCS_INSTANCE_NUMBER <=97
error_message = "The SAP_ASCS_INSTANCE_NUMBER is not valid."
}
}
variable "SAP_ERS_INSTANCE_NUMBER" {
type = string
description = "The enqueue replication server instance number. Technical identifier for internal processes of ERS. Consists of a two-digit number from 00 to 97. Must be unique on a host. Must follow the SAP rules for instance number naming."
default = "01"
validation {
condition = var.SAP_ERS_INSTANCE_NUMBER >= 00 && var.SAP_ERS_INSTANCE_NUMBER <=99
error_message = "The SAP_ERS_INSTANCE_NUMBER is not valid."
}
}
variable "SAP_CI_INSTANCE_NUMBER" {
type = string
description = "The SAP central instance number. Technical identifier for internal processes of PAS. Consists of a two-digit number from 00 to 97. Must be unique on a host. Must follow the SAP rules for instance number naming"
default = "10"
validation {
condition = var.SAP_CI_INSTANCE_NUMBER >= 00 && var.SAP_CI_INSTANCE_NUMBER <=99
error_message = "The SAP_CI_INSTANCE_NUMBER is not valid."
}
}
variable "SAP_AAS_INSTANCE_NUMBER" {
type = string
description = "The SAP additional application server instance number. Technical identifier for internal processes of AAS. Consists of a two-digit number from 00 to 97. Must be unique on a host. Must follow the SAP rules for instance number naming"
default = "20"
validation {
condition = var.SAP_AAS_INSTANCE_NUMBER >= 00 && var.SAP_AAS_INSTANCE_NUMBER <=99
error_message = "The SAP_AAS_INSTANCE_NUMBER is not valid."
}
}
variable "HANA_SYSNO" {
type = string
description = "The instance number of the SAP HANA system."
default = "00"
validation {
condition = var.HANA_SYSNO >= 0 && var.HANA_SYSNO <=97
error_message = "The HANA_SYSNO is not valid."
}
}
variable "HANA_MAIN_PASSWORD" {
type = string
sensitive = true
description = "The SAP HANA MAIN Password. Must be 8 to 14 characters long, contain at least one digit (0-9), one uppercase letter, and must not contain \\ (backslash) or \" (double quote)."
validation {
condition = length(var.HANA_MAIN_PASSWORD) >= 8 && length(var.HANA_MAIN_PASSWORD) <= 14 && length(regexall("[0-9]", var.HANA_MAIN_PASSWORD)) > 0 && length(regexall("[A-Z]", var.HANA_MAIN_PASSWORD)) > 0 && length(regexall("[a-z]", var.HANA_MAIN_PASSWORD)) > 0 && length(regexall("[\\\\\"]", var.HANA_MAIN_PASSWORD)) == 0 && length(regexall("[\"]", var.HANA_MAIN_PASSWORD)) == 0
error_message = "The HANA_MAIN_PASSWORD is not valid. It must be 8 to 14 characters long and must contain at least one digit, one uppercase letter, one lowercase letter. It must not contain \\ (backslash) or \" (double quote)."
}
}
variable "HANA_SYSTEM_USAGE" {
type = string
description = "System Usage. Default: \"custom\". Valid values: \"production\", \"test\", \"development\", \"custom\"."
default = "custom"
validation {
condition = contains(["production", "test", "development", "custom" ], var.HANA_SYSTEM_USAGE )
error_message = "The HANA_SYSTEM_USAGE must be one of: production, test, development, custom."
}
}
variable "HANA_COMPONENTS" {
type = string
description = "SAP HANA Components. Default: \"server\". Valid values: \"all\", \"client\", \"es\", \"ets\", \"lcapps\", \"server\", \"smartda\", \"streaming\", \"rdsync\", \"xs\", \"studio\", \"afl\", \"sca\", \"sop\", \"eml\", \"rme\", \"rtl\", \"trp\"."
default = "server"
validation {
condition = contains(["all", "client", "es", "ets", "lcapps", "server", "smartda", "streaming", "rdsync", "xs", "studio", "afl", "sca", "sop", "eml", "rme", "rtl", "trp" ], var.HANA_COMPONENTS )
error_message = "The HANA_COMPONENTS must be one of: all, client, es, ets, lcapps, server, smartda, streaming, rdsync, xs, studio, afl, sca, sop, eml, rme, rtl, trp."
}
}
variable "KIT_SAPHANA_FILE" {
type = string
description = "Path to SAP HANA ZIP file, as downloaded from SAP Support Portal."
default = "/storage/HANADB/SP07/Rev73/51057281.ZIP"
}
variable "SAP_SID" {
type = string
description = "The SAP system ID identifies the entire SAP system. Consists of three alphanumeric characters and the first character must be a letter. Does not include any of the reserved IDs listed in SAP Note 1979280"
default = "S4A"
validation {
condition = length(regexall("^[a-zA-Z][a-zA-Z0-9][a-zA-Z0-9]$", var.SAP_SID)) > 0 && !contains(["ADD", "ALL", "AMD", "AND", "ANY", "ARE", "ASC", "AUX", "AVG", "BIT", "CDC", "COM", "CON", "DBA", "END", "EPS", "FOR", "GET", "GID", "IBM", "INT", "KEY", "LOG", "LPT", "MAP", "MAX", "MIN", "MON", "NIX", "NOT", "NUL", "OFF", "OLD", "OMS", "OUT", "PAD", "PRN", "RAW", "REF", "ROW", "SAP", "SET", "SGA", "SHG", "SID", "SQL", "SUM", "SYS", "TMP", "TOP", "UID", "USE", "USR", "VAR"], var.SAP_SID)
error_message = "The SAP_SID is not valid."
}
}
variable "SAP_MAIN_PASSWORD" {
type = string
sensitive = true
description = "The SAP MAIN Password. Must be 8 to 14 characters long, must contain at least one digit (0-9) and one uppercase letter, and must not contain \\ (backslash) and \" (double quote)."
validation {
condition = length(var.SAP_MAIN_PASSWORD) >= 8 && length(var.SAP_MAIN_PASSWORD) <= 14 && length(regexall("[0-9]", var.SAP_MAIN_PASSWORD)) > 0 && length(regexall("[A-Z]", var.SAP_MAIN_PASSWORD)) > 0 && length(regexall("[\\\\\"]", var.SAP_MAIN_PASSWORD)) == 0
error_message = "The SAP_MAIN_PASSWORD is not valid. It must be 8 to 14 characters long and contain at least one digit and one uppercase letter. It must not contain \\ (backslash) or \" (double quote)."
}
}
variable "HA_PASSWORD" {
type = string
sensitive = true
description = "The HA Cluster Password. Must be 8 to 14 characters long and contain at least one digit and one uppercase letter. It must not contain \\ (backslash) or \" (double quote)."
validation {
condition = length(var.HA_PASSWORD) >= 8 && length(var.HA_PASSWORD) <= 14 && length(regexall("[0-9]", var.HA_PASSWORD)) > 0 && length(regexall("[A-Z]", var.HA_PASSWORD)) > 0 && length(regexall("[\\\\\"]", var.HA_PASSWORD)) == 0
error_message = "The HA_PASSWORD is not valid. It must be 8 to 14 characters long and contain at least one digit and one uppercase letter. It must not contain \\ (backslash) or \" (double quote)."
}
}
variable "HDB_CONCURRENT_JOBS" {
type = string
description = "Number of concurrent jobs used to load and/or extract archives to HANA Host."
default = "23"
validation {
condition = var.HDB_CONCURRENT_JOBS >= 1 && var.HDB_CONCURRENT_JOBS <=25
error_message = "The HDB_CONCURRENT_JOBS is not valid."
}
}
variable "KIT_SAPCAR_FILE" {
type = string
description = "Path to sapcar binary, as downloaded from SAP Support Portal."
default = "/storage/S4HANA/SAPCAR_1010-70006178.EXE"
}
variable "KIT_SWPM_FILE" {
type = string
description = "Path to SWPM archive (SAR), as downloaded from SAP Support Portal."
default = "/storage/S4HANA/SWPM20SP17_0-80003424.SAR"
}
variable "KIT_SAPEXE_FILE" {
type = string
description = "Path to SAP Kernel OS archive (SAR), as downloaded from SAP Support Portal."
default = "/storage/S4HANA/KERNEL/793/SAPEXE_60-70007807.SAR"
}
variable "KIT_SAPEXEDB_FILE" {
type = string
description = "Path to SAP Kernel DB archive (SAR), as downloaded from SAP Support Portal."
default = "/storage/S4HANA/KERNEL/793/SAPEXEDB_60-70007806.SAR"
}
variable "KIT_IGSEXE_FILE" {
type = string
description = "Path to IGS archive (SAR), as downloaded from SAP Support Portal."
default = "/storage/S4HANA/KERNEL/793/igsexe_4-70005417.sar"
}
variable "KIT_IGSHELPER_FILE" {
type = string
description = "Path to IGS Helper archive (SAR), as downloaded from SAP Support Portal."
default = "/storage/S4HANA/igshelper_17-10010245.sar"
}
variable "KIT_SAPHOSTAGENT_FILE" {
type = string
description = "Path to SAP Host Agent archive (SAR), as downloaded from SAP Support Portal."
default = "/storage/S4HANA/SAPHOSTAGENT61_61-80004822.SAR"
}
variable "KIT_HDBCLIENT_FILE" {
type = string
description = "Path to HANA DB client archive (SAR), as downloaded from SAP Support Portal."
default = "/storage/S4HANA/IMDB_CLIENT20_018_27-80002082.SAR"
}
variable "KIT_S4HANA_EXPORT" {
type = string
description = "Path to S/4HANA Installation Export dir. The archives downloaded from SAP Support Portal should be present in this path."
default = "/storage/S4HANA/2023"
}