@@ -196,6 +196,10 @@ variable "bastion_state" {
196196 description = " The target state for the bastion instance. Could be set to RUNNING or STOPPED. (Updatable)"
197197 default = " RUNNING"
198198 type = string
199+ validation {
200+ condition = contains ([" RUNNING" , " STOPPED" ], var. bastion_state )
201+ error_message = " Accepted values are RUNNING or STOPPED."
202+ }
199203}
200204
201205variable "bastion_timezone" {
@@ -208,6 +212,11 @@ variable "bastion_type" {
208212 description = " Whether to make the bastion host public or private."
209213 default = " public"
210214 type = string
215+
216+ validation {
217+ condition = contains ([" public" , " private" ], var. bastion_type )
218+ error_message = " Accepted values are public or private."
219+ }
211220}
212221
213222variable "upgrade_bastion" {
@@ -313,6 +322,11 @@ variable "operator_state" {
313322 description = " The target state for the operator instance. Could be set to RUNNING or STOPPED. (Updatable)"
314323 default = " RUNNING"
315324 type = string
325+ validation {
326+ condition = contains ([" RUNNING" , " STOPPED" ], var. operator_state )
327+ error_message = " Accepted values are RUNNING or STOPPED."
328+ }
329+
316330}
317331
318332variable "operator_timezone" {
@@ -399,6 +413,11 @@ variable "control_plane_access" {
399413 default = " public"
400414 description = " Whether to allow public or private access to the control plane endpoint"
401415 type = string
416+
417+ validation {
418+ condition = contains ([" public" , " private" ], var. control_plane_access )
419+ error_message = " Accepted values are public, or private."
420+ }
402421}
403422
404423variable "control_plane_access_source" {
@@ -469,6 +488,10 @@ variable "check_node_active" {
469488 description = " check worker node is active"
470489 type = string
471490 default = " none"
491+ validation {
492+ condition = contains ([" none" , " one" , " all" ], var. check_node_active )
493+ error_message = " Accepted values are none, one or all."
494+ }
472495}
473496
474497variable "node_pools" {
@@ -509,6 +532,10 @@ variable "worker_mode" {
509532 default = " private"
510533 description = " Whether to provision public or private workers."
511534 type = string
535+ validation {
536+ condition = contains ([" public" , " private" ], var. worker_mode )
537+ error_message = " Accepted values are public or private."
538+ }
512539}
513540
514541# upgrade of existing node pools
@@ -537,6 +564,10 @@ variable "lb_subnet_type" {
537564 default = " public"
538565 description = " The type of load balancer subnets to create."
539566 type = string
567+ validation {
568+ condition = contains ([" public" , " internal" , " both" ], var. lb_subnet_type )
569+ error_message = " Accepted values are public, internal or both."
570+ }
540571}
541572
542573variable "preferred_lb_subnet_type" {
@@ -545,6 +576,10 @@ variable "preferred_lb_subnet_type" {
545576 default = " public"
546577 description = " The preferred load balancer subnets that OKE will automatically choose when creating a load balancer. valid values are public or internal. if 'public' is chosen, the value for lb_subnet_type must be either 'public' or 'both'. If 'private' is chosen, the value for lb_subnet_type must be either 'internal' or 'both'."
547578 type = string
579+ validation {
580+ condition = contains ([" public" , " internal" ], var. preferred_lb_subnet_type )
581+ error_message = " Accepted values are public or internal."
582+ }
548583}
549584
550585variable "public_lb_ports" {
0 commit comments