Last active
October 6, 2022 21:00
-
-
Save guillermo-musumeci/2e1b845610db0a7fa4e9feee5b8aad14 to your computer and use it in GitHub Desktop.
Variable Validation in Terraform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| variable "server_name" { | |
| type = string | |
| description = "Server name in letters and numbers only)" | |
| validation { | |
| condition = can(regex("^[0-9A-Za-z]+$", var.storage_account_name)) | |
| error_message = "The server name variable must have letters and numbers only" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment