Cloud function name allow underscores. (#3265)

This commit is contained in:
Andrey Tataranovich 2019-03-19 00:10:58 +03:00 committed by emily
parent b309ccdaab
commit 1b38f4c4d7

View File

@ -101,9 +101,9 @@ func resourceCloudFunctionsFunction() *schema.Resource {
errors = append(errors, fmt.Errorf(
"%q cannot be longer than 48 characters", k))
}
if !regexp.MustCompile("^[a-zA-Z0-9-]+$").MatchString(value) {
if !regexp.MustCompile("^[a-zA-Z0-9-_]+$").MatchString(value) {
errors = append(errors, fmt.Errorf(
"%q can only contain letters, numbers and hyphens", k))
"%q can only contain letters, numbers, underscores and hyphens", k))
}
if !regexp.MustCompile("^[a-zA-Z]").MatchString(value) {
errors = append(errors, fmt.Errorf(