Skip to content

Commit

Permalink
Finalized Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
WodansSon committed Jul 10, 2019
1 parent 200f2a8 commit 8291122
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 250 deletions.
12 changes: 10 additions & 2 deletions azurerm/helpers/azure/frontdoor.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ import (

//Frontdoor name must begin with a letter or number, end with a letter or number and may contain only letters, numbers or hyphens.
func ValidateFrontDoorName(i interface{}, k string) (_ []string, errors []error) {
if m, regexErrs := validate.RegExHelper(i, k, `^[\da-zA-Z]([-\da-z]{4,61})[\da-zA-Z]?$`); !m {
errors = append(regexErrs, fmt.Errorf(`%q must begin with a letter or number, end with a letter or number and may contain only letters, numbers or hyphens.`, k))
if m, regexErrs := validate.RegExHelper(i, k, `(^[\da-zA-Z])([-\da-zA-Z]{3,61})([\da-zA-Z]$)`); !m {
errors = append(regexErrs, fmt.Errorf(`%q must be between 5 and 63 characters in length and begin with a letter or number, end with a letter or number and may contain only letters, numbers or hyphens.`, k))
}

return nil, errors
}

func ValidateBackendPoolRoutingRuleName(i interface{}, k string) (_ []string, errors []error) {
if m, regexErrs := validate.RegExHelper(i, k, `(^[\da-zA-Z])([-\da-zA-Z]{1,88})([\da-zA-Z]$)`); !m {
errors = append(regexErrs, fmt.Errorf(`%q must be between 1 and 90 characters in length and begin with a letter or number, end with a letter or number and may contain only letters, numbers or hyphens.`, k))
}

return nil, errors
}
Loading

0 comments on commit 8291122

Please sign in to comment.