Skip to content

Commit

Permalink
Fix epg variable validation
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed May 23, 2024
1 parent 937b2ad commit 3753b30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/terraform-aci-endpoint-group/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,14 @@ variable "static_ports" {

validation {
condition = alltrue([
for sp in var.static_ports : sp.ptp == null || try(contains(["multicast", "multicast-master", "unicast-master"], sp.ptp_mode), false)
for sp in var.static_ports : try(contains(["multicast", "multicast-master", "unicast-master"], sp.ptp_mode), false)
])
error_message = "`ptp_mode`: Allowed values are `multicast`, `multicast-master` or `unicast-master`."
}

validation {
condition = alltrue([
for sp in var.static_ports : can(regex("^[a-zA-Z0-9_.:-]{0,16}$", sp.ptp_profile))
for sp in var.static_ports : sp.ptp_profile == null || can(regex("^[a-zA-Z0-9_.:-]{0,16}$", sp.ptp_profile))
])
error_message = "`ptp_profile`: Allowed characters: `a`-`z`, `A`-`Z`, `0`-`9`, `_`, `.`, `:`, `-`. Maximum characters: 16."
}
Expand Down

0 comments on commit 3753b30

Please sign in to comment.