variable "name" { validation { condition = can(regex("^[a-z][a-z0-9-]{1,45}[a-z0-9]$", var.name)) error_message = "Expected a lowercase resource name." } type = string } variable "host_count" { validation { condition = var.host_count >= 1 && var.host_count <= 6 && floor(var.host_count) == var.host_count error_message = "Use 1–6 hosts." } type = number } variable "vpc_cidr" { type = string } variable "deployment_bucket_name" { validation { condition = can(regex("^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$", var.deployment_bucket_name)) error_message = "Expected an S3 bucket name." } type = string } variable "deployment_bucket_arn" { type = string } variable "deployment_region" { validation { condition = can(regex("^[a-z]{2}-[a-z]+-[0-9]+$", var.deployment_region)) error_message = "Expected an AWS region name." } type = string } variable "data_bucket_name" { validation { condition = can(regex("^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$", var.data_bucket_name)) error_message = "Expected an S3 bucket name." } type = string } variable "data_bucket_arn" { type = string } variable "placement_region" { validation { condition = can(regex("^[a-z][a-z0-9-]{0,31}$", var.placement_region)) error_message = "Expected a lowercase placement region." } type = string } variable "release_public_key" { validation { condition = can(regex("^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$", var.release_public_key)) error_message = "Expected a base64 32-byte Ed25519 public key." } type = string } variable "apps_domain" { validation { condition = length(var.apps_domain) <= 253 && can(regex("^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$", var.apps_domain)) error_message = "Expected a lowercase DNS domain without a scheme or path." } type = string } variable "instance_type" { type = string default = "t4g.small" } variable "root_volume_gib" { type = number default = 20 }