-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvariables.tf
1351 lines (1127 loc) · 32.7 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
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
####################
# Azure environment
####################
variable "subscription_id" {
description = "Subscriptions ID to be used."
type = string
default = ""
}
variable "client_id" {
description = "Client ID from Azure."
type = string
default = ""
}
variable "client_secret" {
description = "Client secret from Azure."
type = string
default = ""
}
variable "tenant_id" {
description = "Tenant ID from Azure."
type = string
default = ""
}
##################
# Azure resources
##################
variable "rg_exists" {
description = "Set if resource group exists or should be created."
type = bool
default = false
}
variable "resource_group" {
description = "Resource group name to create."
type = string
default = "rg-sap"
}
variable "location" {
description = "Location where resources should be created."
type = string
default = "eastus"
}
################
# Azure network
################
variable "vnet_exists" {
description = "Set if vnet exists to decide to use an existent or create a new one."
type = bool
default = true
}
variable "vnet_name" {
description = "Name of virtual network."
type = string
default = "vnet"
}
variable "vnet_addr" {
description = "Network address for virtual network."
type = string
default = "10.0.0.0/16"
}
variable "vnet_rg" {
description = "Vnet's resource group."
type = string
default = "rg-vnet"
}
variable "subnet_exists" {
description = "Set if subnet exists to decide to use an existent or create a new one."
type = bool
default = true
}
variable "subnet_name" {
description = "Name of virtual subnet."
type = string
default = "subnet"
}
variable "subnet_addr" {
description = "Network address Name of virtual subnet."
type = string
default = "10.0.1.0/24"
}
###################
# User information
###################
variable "admin_username" {
description = "Name for the admin user."
type = string
default = "azureroot"
}
variable "admin_password" {
description = "Password for admin user."
type = string
default = "Passw0rd"
}
###################
# Availability set
###################
variable "availability_set_enabled" {
description = "Set if Availability set should be used or not."
type = bool
default = false
}
variable "availability_set_name" {
description = "Availability set name."
type = string
default = "availability_set"
}
############################
# Proximity placement group
############################
variable "proximity_pg_enabled" {
description = "Set if proximity placement group should be used or not."
type = bool
default = false
}
variable "proximity_pg_exists" {
description = "Set if proximity placement group exists or one should be created."
type = bool
default = false
}
variable "proximity_pg_name" {
description = "Proximity placement group name."
type = string
default = "proximity_placement_group"
}
variable "proximity_pg_rg" {
description = "Resource group of Proximity placement group."
type = string
default = ""
}
########################
# Storage for SAP Media
########################
variable "sap_media_stg_enabled" {
description = "Set if storage for SAP Media should be enabled or not."
type = bool
default = false
}
variable "sap_media_stg_type" {
description = "Set storage type to create for SAP Media."
type = string
default = "nfsv4"
validation {
condition = contains(["nfsv3", "nfsv4", "smb"], var.sap_media_stg_type)
error_message = "Storage type SAP media not supported."
}
}
variable "sap_media_stg_exists" {
description = "Set if storage account for SAP Media exists or if one should be created."
type = bool
default = true
}
variable "sap_media_stg_account" {
description = "Storage account for SAP Media."
type = string
default = "storagesapmedia"
validation {
condition = can(regex("[0-9a-z]{3,24}", var.sap_media_stg_account))
error_message = "Storage account name for SAP media not matching rules from Azure."
}
}
variable "sap_media_stg_rg" {
description = "Storage account's resource group for SAP Media."
type = string
default = "rg-sap-media"
}
variable "sap_media_stg_tier" {
description = "Tier to create storage account for SAP Media."
type = string
default = "Standard"
validation {
condition = contains(["Standard", "Premium"], var.sap_media_stg_tier)
error_message = "SAP media tier not supported."
}
}
variable "sap_media_stg_repl" {
description = "Storage replication type to create storage account for SAP Media."
type = string
default = "LRS"
validation {
condition = contains(["LRS", "GRS", "RAGRS", "ZRS", "GZRS", "RAGZRS"], var.sap_media_stg_repl)
error_message = "SAP media replication type not supported."
}
}
variable "sap_media_stg_account_kind" {
description = "Kind of storage to create storage account for SAP Media."
type = string
default = "StorageV2"
validation {
condition = contains(["BlobStorage", "BlockBlobStorage", "FileStorage", "Storage", "StorageV2"], var.sap_media_stg_account_kind)
error_message = "SAP media account kind not supported."
}
}
variable "sap_media_stg_access_key" {
description = "Access key to access storage account for SAP media."
type = string
default = ""
}
variable "sap_media_stg_remote_path" {
description = "Path for SAP media in storage account."
type = string
default = "/sapmedia"
}
variable "sap_media_local_mount" {
description = "Path for mounting SAP media on server."
type = string
default = "/mnt/sapmedia"
}
variable "sap_media_local_add_fstab" {
description = "Add SAP media entry to /etc/fstab file."
type = bool
default = false
}
variable "sap_media_stg_pe_enabled" {
description = "Set if private endpoint should be enabled or not for SAP Media storage account."
type = bool
default = false
}
variable "sap_media_stg_pe_exists" {
description = "Set if private endpoint exists or one should be created."
type = bool
default = false
}
variable "sap_media_stg_pe_name" {
description = "Set private endpoint name for SAP Media storage account."
type = string
default = ""
}
###################################
# Storage for SAP Application data
###################################
variable "data_stg_enabled" {
description = "Set if storage for SAP data should be enabled or not."
type = bool
default = false
}
variable "data_stg_exists" {
description = "Set if storage account for data exists or if one should be created."
type = bool
default = true
}
variable "data_stg_account" {
description = "Storage account for SAP data."
type = string
default = "stgdata"
validation {
condition = can(regex("[0-9a-z]{3,24}", var.data_stg_account))
error_message = "Storage account name for SAP data not matching rules from Azure."
}
}
variable "data_stg_rg" {
description = "Storage account's resource group for SAP data."
type = string
default = "rg-data"
}
variable "data_stg_tier" {
description = "Tier to create storage account for SAP data."
type = string
default = "Premium"
validation {
condition = contains(["Premium"], var.data_stg_tier)
error_message = "SAP data supported only in Premium storage accounts."
}
}
variable "data_stg_repl" {
description = "Storage replication type to create storage account for SAP data."
type = string
default = "LRS"
validation {
condition = contains(["LRS", "GRS", "RAGRS", "ZRS", "GZRS", "RAGZRS"], var.data_stg_repl)
error_message = "SAP data replication type not supported."
}
}
variable "data_stg_account_kind" {
description = "Kind of storage to create storage account for SAP data."
type = string
default = "FileStorage"
validation {
condition = contains(["FileStorage"], var.data_stg_account_kind)
error_message = "SAP data support for NFS 4.1 available only in FileStorage."
}
}
variable "data_stg_remote_path" {
description = "Path in storage account where data for SAP is found."
type = string
default = "/sapecp"
validation {
condition = try(
length(regex("^\\/[[:alnum:]]+", var.data_stg_remote_path)) > 2
)
error_message = "SAP data remote path not formatted properly."
}
}
variable "data_stg_remote_clean" {
description = "Set if remote path on NFS should be cleared or not."
type = bool
default = true
}
variable "data_stg_local_add_fstab" {
description = "Add SAP NFS entry to /etc/fstab file."
type = bool
default = true
}
variable "data_stg_pe_enabled" {
description = "Set if private endpoint should be created in the storage account."
type = bool
default = false
}
variable "data_stg_pe_exists" {
description = "Set if private endpoint exists or one should be created."
type = bool
default = false
}
variable "data_stg_pe_name" {
description = "Set name of private endpoint."
type = string
default = ""
}
#############################
# Storage for SAP trans data
#############################
variable "saptrans_stg_enabled" {
description = "Set if storage for SAP trans should be enabled or not."
type = bool
default = false
}
variable "saptrans_stg_type" {
description = "Set storage type for usage with SAP saptrans."
type = string
default = "stga"
validation {
condition = contains(["stga", "nfs"], var.saptrans_stg_type)
error_message = "SAP saptrans data supported only with Azure Storage Account or NFS share."
}
}
variable "saptrans_stg_exists" {
description = "Set if storage account for saptrans exists or if one should be created."
type = bool
default = true
}
variable "saptrans_stg_account" {
description = "Storage account for SAP saptrans data."
type = string
default = "stgsaptrans"
validation {
condition = can(regex("[0-9a-z]{3,24}", var.saptrans_stg_account))
error_message = "Storage account name for saptrans not matching rules from Azure."
}
}
variable "saptrans_stg_rg" {
description = "Storage account's resource group for SAP saptrans data."
type = string
default = "rg-saptrans"
}
variable "saptrans_stg_tier" {
description = "Tier to create storage account for SAP saptrans data."
type = string
default = "Premium"
validation {
condition = contains(["Premium"], var.saptrans_stg_tier)
error_message = "SAP saptrans data supported only in Premium storage accounts."
}
}
variable "saptrans_stg_repl" {
description = "Storage replication type to create storage account for SAP saptrans data."
type = string
default = "LRS"
validation {
condition = contains(["LRS", "GRS", "RAGRS", "ZRS", "GZRS", "RAGZRS"], var.saptrans_stg_repl)
error_message = "SAP trans replication type not supported."
}
}
variable "saptrans_stg_account_kind" {
description = "Kind of storage to create storage account for SAP saptrans data."
type = string
default = "FileStorage"
validation {
condition = contains(["FileStorage"], var.saptrans_stg_account_kind)
error_message = "SAP trans account kind not supported."
}
}
variable "saptrans_stg_access_key" {
description = "Access key to access storage account for SAP saptrans data."
type = string
default = ""
}
variable "saptrans_stg_remote_path" {
description = "Path in storage account where data for SAP saptrans is found."
type = string
default = "/sapecp"
# validation {
# condition = try(
# length(regex("^\\/[[:alnum:]]+", var.saptrans_stg_remote_path)) > 2,
# length(regex("^[[:alnum:]]:\\(\\/[[:alnum:]]\\)+", var.saptrans_stg_remote_path)) > 10
# )
# error_message = "SAP trans remote path not formatted properly."
# }
}
variable "saptrans_stg_remote_clean" {
description = "Set if remote path on NFS should be cleared or not."
type = bool
default = true
}
variable "saptrans_stg_local_add_fstab" {
description = "Add SAP saptrans NFS entry to /etc/fstab file."
type = bool
default = true
}
variable "saptrans_stg_pe_enabled" {
description = "Set if private endpoint should be created in the storage account for SAP trans."
type = bool
default = false
}
variable "saptrans_stg_pe_exists" {
description = "Set if private endpoint exists or one should be created for the storage account for SAP trans."
type = bool
default = false
}
variable "saptrans_stg_pe_name" {
description = "Set name for private endpoint of the storage account for SAP trans."
type = string
default = ""
}
########################
# Storage for instances
########################
variable "vm_data_stg_exists" {
description = "Set if storage account for data exists or if one should be created."
type = bool
default = false
}
variable "vm_data_stg_account" {
description = "Storage account for instances."
type = string
default = "stgvmdata"
validation {
condition = can(regex("[0-9a-z]{3,24}", var.vm_data_stg_account))
error_message = "Storage account name for instances not matching rules from Azure."
}
}
variable "vm_data_stg_rg" {
description = "Storage account's resource group for instances."
type = string
default = "rg-vm"
}
variable "vm_data_stg_tier" {
description = "Tier to create storage account for instances."
type = string
default = "Standard"
validation {
condition = contains(["Standard", "Premium"], var.vm_data_stg_tier)
error_message = "Storage account tier type for instances not supported."
}
}
variable "vm_data_stg_repl" {
description = "Storage replication type to create storage account for instances."
type = string
default = "LRS"
validation {
condition = contains(["LRS", "GRS", "RAGRS", "ZRS", "GZRS", "RAGZRS"], var.vm_data_stg_repl)
error_message = "Storage account replication type for instances not supported."
}
}
variable "vm_data_stg_account_kind" {
description = "Kind of storage to create storage account for instances."
type = string
default = "StorageV2"
validation {
condition = contains(["BlobStorage", "BlockBlobStorage", "FileStorage", "Storage", "StorageV2"], var.vm_data_stg_account_kind)
error_message = "Storage account kind for instances not supported."
}
}
###################
# Boot diagnostics
###################
variable "boot_diag_stg_enabled" {
description = "Set if storage account for boot diagnostics should be enabled or not."
type = bool
default = false
}
variable "boot_diag_stg_exists" {
description = "Set if storage account exists and should be used or not exists and should be created."
type = bool
default = true
}
variable "boot_diag_stg_account" {
description = "Storage account for boot diagnostics."
type = string
default = "storage"
validation {
condition = can(regex("[0-9a-z]{3,24}", var.boot_diag_stg_account))
error_message = "Storage account name not matching rules from Azure."
}
}
variable "boot_diag_stg_rg" {
description = "Storage account's resource group for boot diagnostics."
type = string
default = "rg-boot-diag"
}
variable "boot_diag_stg_tier" {
description = "Tier used for storage account used in boot diagnostics."
type = string
default = "Standard"
validation {
condition = contains(["Standard", "Premium"], var.boot_diag_stg_tier)
error_message = "Storage account tier type for boot diagnostics not supported."
}
}
variable "boot_diag_stg_repl" {
description = "Storage replication type to create storage account."
type = string
default = "LRS"
validation {
condition = contains(["LRS", "GRS", "RAGRS", "ZRS", "GZRS", "RAGZRS"], var.boot_diag_stg_repl)
error_message = "Storage account replication type for boot diagnostics not supported."
}
}
variable "boot_diag_stg_account_kind" {
description = "Storage account kind for boot diagnostics."
type = string
default = "StorageV2"
validation {
condition = contains(["BlobStorage", "BlockBlobStorage", "FileStorage", "Storage", "StorageV2"], var.boot_diag_stg_account_kind)
error_message = "Storage account kind for boot diagnostics not supported."
}
}
######
# VMs
######
variable "vms" {
description = "List of VMs to create"
type = list(object({
name = string
size = string
image = object({
publisher = string
offer = string
sku = string
version = string
})
add_pub_ip = bool
pub_ip_persist = bool
add_boot_diag = bool
priv_ip_dynamic = bool
priv_ip_addr = string
disk_type = string
disk_size_gb = number
add_extra_disk = bool
extra_disk_size_gb = number
net_accel = bool
cloudinit = string
swap_size = number
os_registration = bool
reg_code = string
reg_email = string
product_id = string
saptune_solution = string
sap_instance = string
})
)
}
#########################
# Network security group
#########################
variable "nsg_enabled" {
description = "Set if NSG should be used or not."
type = bool
default = true
}
variable "nsg_exists" {
description = "Set if NSG exists and should be used or a new one should be created."
type = bool
default = false
}
variable "nsg_name" {
description = "Network security group name."
type = string
default = ""
}
variable "nsg_rg" {
description = "Network security group's resource group."
type = string
default = ""
}
variable "nsg_rules" {
description = "Network security group rules."
type = list(object({
name = string
direction = string
access = string
protocol = string
source_port_range = string
destination_port_range = string
source_address_prefix = string
destination_address_prefix = string
enabled = bool
})
)
validation {
condition = alltrue([
for rule in var.nsg_rules : contains(["Inbound", "Outbound"], rule.direction)
])
error_message = "Directing rule not supported."
}
validation {
condition = alltrue([
for rule in var.nsg_rules : contains(["Allow", "Deny"], rule.access)
])
error_message = "Access type not supported."
}
validation {
condition = alltrue([
for rule in var.nsg_rules: contains(["Tcp", "Udp", "Icmp", "Esp", "Ah", "*"], rule.protocol)
])
error_message = "Protocol not supported."
}
validation {
condition = alltrue([
for rule in var.nsg_rules: try(rule.source_port_range == "*",
tonumber(element(rule.source_port_range, 0)) <= 65535)
])
error_message = "Invalid source port range."
}
validation {
condition = alltrue([
for rule in var.nsg_rules: try(rule.destination_port_range == "*",
tonumber(rule.destination_port_range) <= 65535)
])
error_message = "Invalid destination port range."
}
}
############################
# Load balancer for cluster
############################
variable "lb_create" {
description = "Set if load balancer should be created."
type = bool
default = false
}
variable "lb_create_public_ip" {
description = "Set if public IP should be attached to the load balancer."
type = bool
default = false
}
variable "lb_name" {
description = "Set Load Balancer name."
type = string
default = "my-lb"
}
variable "lb_sku" {
description = "Set LB SKU to use."
type = string
default = "Basic"
}
variable "lb_frontend_ip" {
description = "Load balancer frontend IP."
type = list(object({
name = string
private_ip = string
})
)
default = [{
name = "lb"
private_ip = "10.0.0.1"
}]
}
variable "lb_probe_rules" {
description = "Load balancer probe rules."
type = list(object({
name = string
port = number
protocol = string
request_path = optional(string)
interval = number
number_of_probes = number
})
)
default = [{
name = ""
port = 0
protocol = "Tcp"
interval = 5
number_of_probes = 2
}]
validation {
condition = alltrue([
for rule in var.lb_probe_rules: try(tonumber(rule.port) <= 65535)
])
error_message = "Invalid port number."
}
validation {
condition = alltrue([
for rule in var.lb_probe_rules: contains(["Http", "Https", "Tcp"], rule.protocol)
])
error_message = "Protocol not supported."
}
validation {
condition = alltrue([
for rule in var.lb_probe_rules: rule.interval >= 5
])
error_message = "Interval out of range."
}
validation {
condition = alltrue([
for rule in var.lb_probe_rules: rule.number_of_probes >= 1
])
error_message = "Number of probes out of range."
}
}
variable "lb_rules" {
description = "Load balancing rules."
type = list(object({
name = string
frontend_name = string
probe_name = string
protocol = string
frontend_port = number
backend_port = number
enable_floating_ip = bool
idle_timeout_in_minutes = number
load_distribution = string
enable_tcp_reset = bool
disable_outbound_snat = bool
})
)
default = [{
name = "rule01"
frontend_name = "frontend"
probe_name = "name"
protocol = "Tcp"
frontend_port = 1000
backend_port = 1000
enable_floating_ip = false
idle_timeout_in_minutes = 4
load_distribution = "SourceIPProtocol"
enable_tcp_reset = false
disable_outbound_snat = true
}]
validation {
condition = alltrue([
for rule in var.lb_rules: contains(["Tcp", "Udp", "All"], rule.protocol)
])
error_message = "Protocol not supported."
}
validation {
condition = alltrue([
for rule in var.lb_rules: try(rule.frontend_port < 65535)
])
error_message = "Invalid port number range."
}
validation {
condition = alltrue([
for rule in var.lb_rules: try(rule.backend_port <= 65535)
])
error_message = "Invalid port number range."
}
validation {
condition = alltrue([
for rule in var.lb_rules: try(rule.idle_timeout_in_minutes >= 4 && rule.idle_timeout_in_minutes <= 30)
])
error_message = "Invalid timeout range in minutes."
}
validation {
condition = alltrue([
for rule in var.lb_rules: contains(["Default", "SourceIP", "SourceIPProtocol"], rule.load_distribution)
])
error_message = "Load distribution not supported."
}
}
#############################
# Load Balancer for Outbound
#############################
variable "lb_out_create" {
description = "Set if Load Balancer for Outbound should be created or not."
type = bool
default = false
}
variable "lb_out_name" {
description = "Set name for Load Balancer used for outbound."
type = string
default = "lb_outbound"
}
variable "lb_out_sku" {
description = "Set SKU for Load Balancer used for outbound."
type = string
default = "Basic"
validation {
condition = contains(["Basic", "Standard"], var.lb_out_sku)
error_message = "SKU type not supported."
}
}
##############
# NAT Gateway
##############
variable "nat_gateway_enabled" {
description = "Set if NAT Gateway should be enabled or not in the subnet."
type = bool
default = false
}
variable "nat_gateway_exists" {
description = "Set if a NAT Gateway already exists in the subnet."
type = bool
default = true
}
variable "nat_gateway_rg" {
description = "Set NAT Gateway Resource Group name."
type = string
default = "nat-gw-rg"
}
variable "nat_gateway_name" {
description = "Set NAT Gateway resource name."
type = string
default = "nat-gw"
}
variable "nat_gateway_pub_ip_persist" {
description = "Set if public IP of NAT Gateway is going to be persistent or not."
type = bool
default = true
}
variable "nat_gateway_sku" {
description = "Set SKU to be used for NAT Gateway and Public IP."
type = string
default = "Standard"
validation {
condition = contains(["Standard"], var.nat_gateway_sku)
error_message = "SKU type not supported."
}
}
variable "nat_gateway_idle_timeout" {
description = "Set NAT Gateway Idle timeout in minutes."
type = number
default = 10
}
variable "nat_gateway_zones" {
description = "Set Availability Zones where NAT Gateway should be located."
type = list(string)
default = ["1"]
}
######################