what was the value of the cluster id which caused the problem
This commit is contained in:
parent
79c4935604
commit
ae2d7f7065
|
@ -36,23 +36,23 @@ func validateElastiCacheClusterId(v interface{}, k string) (ws []string, errors
|
|||
value := v.(string)
|
||||
if (len(value) < 1) || (len(value) > 20) {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"%q must contain from 1 to 20 alphanumeric characters or hyphens", k))
|
||||
"%q (%q) must contain from 1 to 20 alphanumeric characters or hyphens", k, value))
|
||||
}
|
||||
if !regexp.MustCompile(`^[0-9a-z-]+$`).MatchString(value) {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"only lowercase alphanumeric characters and hyphens allowed in %q", k))
|
||||
"only lowercase alphanumeric characters and hyphens allowed in %q (%q)", k, value))
|
||||
}
|
||||
if !regexp.MustCompile(`^[a-z]`).MatchString(value) {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"first character of %q must be a letter", k))
|
||||
"first character of %q (%q) must be a letter", k, value))
|
||||
}
|
||||
if regexp.MustCompile(`--`).MatchString(value) {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"%q cannot contain two consecutive hyphens", k))
|
||||
"%q (%q) cannot contain two consecutive hyphens", k, value))
|
||||
}
|
||||
if regexp.MustCompile(`-$`).MatchString(value) {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"%q cannot end with a hyphen", k))
|
||||
"%q (%q) cannot end with a hyphen", k, value))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue