diff --git a/variables.tf b/variables.tf index a6f5bff..b4117f4 100644 --- a/variables.tf +++ b/variables.tf @@ -3,6 +3,21 @@ variable "instance_size" { description = "Size of instance to create" default = "t2.micro" + validation { + condition = ( + var.instance_size == "t2.micro" || + var.instance_size == "t3.medium" || + var.instance_size == "m5.large" || + var.instance_size == "c5.large" || + var.instance_size == "c5a.large" || + var.instance_size == "m5.2xlarge" || + var.instance_size == "c5.2xlarge" || + var.instance_size == "m5.4xlarge" || + var.instance_size == "c5.4xlarge" || + var.instance_size == "m6i.large" + ) + error_message = "Input instance_size must be set to an approved vm instance type." + } } variable "vpc_cidr" {