You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/hcl2template/testdata/variables/validation/valid.pkr.hcl

18 lines
362 B

variable "image_id" {
type = string
default = "ami-something-something"
validation {
condition = length(var.image_id) > 4 && substr(var.image_id, 0, 4) == "ami-"
error_message = "The image_id value must be a valid AMI id, starting with \"ami-\"."
}
}
source "null" "test" {
communicator = "none"
}
build {
sources = ["null.test"]
}