Skip to content

Commit 57eb0e9

Browse files
committed
Added validation to some of the variables.
1 parent 261cfa9 commit 57eb0e9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Solutions/FSxN-as-PVC-for-EKS/terraform/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,29 @@ variable "fsx_password_secret_name" {
2121
variable "fsxn_throughput_capacity" {
2222
default = 128
2323
description = "The throughput capacity to be allocated to the FSxN cluster. Must be 128, 256, 512, 1024, 2048, 4096."
24+
validation {
25+
condition = var.fsxn_throughput_capacity in [128, 256, 512, 1024, 2048, 4096]
26+
error_message = "The throughput capacity must be 128, 256, 512, 1024, 2048, or 4096."
27+
}
2428
}
2529

2630
variable "fsxn_storage_capacity" {
2731
default = 1024
2832
description = "The storage capacity, in GiBs, to be allocated to the FSxN clsuter. Must be at least 1024, and less than 196608."
33+
validation {
34+
condition = var.fsxn_storage_capacity >= 1024 && var.fsxn_storage_capacity < 196608
35+
error_message = "The storage capacity must be at least 1024, and less than 196608."
36+
}
2937
}
3038
#
3139
# Keep in mind that key pairs are regional, so pick one that is in the region specified above.
3240
variable "key_pair_name" {
3341
default = "MUST REPLACE WITH YOUR KEY PAIR NAME"
3442
description = "The key pair to associate with the jump server."
43+
validation {
44+
condition = var.key_pair_name != "MUST REPLACE WITH YOUR KEY PAIR NAME"
45+
error_message = "You must specify a key pair name."
46+
}
3547
}
3648

3749
variable "secure_ips" {

0 commit comments

Comments
 (0)