diff --git a/variables.tf b/variables.tf index 6e2ece3..87191aa 100644 --- a/variables.tf +++ b/variables.tf @@ -63,6 +63,17 @@ variable "instance_type" { } } +variable "instance_volume_size" { + type = number + description = "The size of the volume in GB for the vSensor instances. The default is 20 GB, but it can be increased if you expect high traffic and more data to be processed by the vSensor." + default = 20 + + validation { + condition = floor(var.instance_volume_size) == var.instance_volume_size && var.instance_volume_size >= 20 && var.instance_volume_size <= 1000 + error_message = "The instance_volume_size must be a whole number between 20 and 1000 GB." + } +} + variable "ssh_keyname" { type = string description = "(Optional) Name of the ssh key pair stored in AWS. This key will be added to the vSensor ssh configuration." diff --git a/vsensors.tf b/vsensors.tf index 13d8e8c..147d1f8 100644 --- a/vsensors.tf +++ b/vsensors.tf @@ -66,8 +66,8 @@ resource "aws_launch_template" "vsensor" { ebs { delete_on_termination = true encrypted = true - volume_size = 20 - volume_type = "gp2" + volume_size = var.instance_volume_size + volume_type = "gp3" } }