variable "aws_account_id" { type = string validation { condition = can(regex("^[0-9]{12}$", var.aws_account_id)) error_message = "Expected a 12-digit AWS account ID." } } variable "name" { type = string default = "carlos" validation { condition = can(regex("^[a-z][a-z0-9-]{1,18}[a-z0-9]$", var.name)) error_message = "Use 3–20 lowercase letters, digits or hyphens, starting with a letter and ending with a letter or digit." } } variable "release_public_key" { type = string validation { condition = can(regex("^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$", var.release_public_key)) error_message = "Expected a base64 32-byte Ed25519 public key." } } variable "apps_domain" { type = string 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." } } variable "instance_type" { type = string default = "t4g.small" validation { condition = can(regex("^(t4g|m[6-9]g|c[6-9]g|r[6-9]g)\\.", var.instance_type)) error_message = "Choose an ARM64 Graviton instance type." } } variable "root_volume_gib" { type = number default = 20 validation { condition = var.root_volume_gib >= 20 && floor(var.root_volume_gib) == var.root_volume_gib error_message = "Use a whole number of GiB, at least 20." } } variable "region" { type = string default = "eu-west-1" validation { condition = can(regex("^[a-z]{2}-[a-z]+-[0-9]+$", var.region)) error_message = "Expected an AWS commercial region name." } }