Skip to content

Instantly share code, notes, and snippets.

@guillermo-musumeci
Created October 6, 2022 09:57
Show Gist options
  • Save guillermo-musumeci/84275662345828f20fbf67182add6a0b to your computer and use it in GitHub Desktop.
Save guillermo-musumeci/84275662345828f20fbf67182add6a0b to your computer and use it in GitHub Desktop.
Variable Validation in Terraform
## Service Plan Variable
variable "service_plan_sku_name" {
type = string
description = "The SKU for the plan. Possible values include EP1, EP2 and EP3."
validation {
condition = contains(["EP1", "EP2", "EP3"], var.service_plan_sku_name)
error_message = "Valid values for the service_plan_sku_name variable are EP1, EP2, EP3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment