Skip to content

Commit

Permalink
Merge pull request #11383 from brad-larson/brad-fix-regexp-validation
Browse files Browse the repository at this point in the history
Fix: Incorrect AWS Lambda Qualifier Regexp
  • Loading branch information
catsby authored Jan 26, 2017
2 parents cae907b + c5c2d27 commit e3c89da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/providers/aws/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func validateLambdaQualifier(v interface{}, k string) (ws []string, errors []err
"%q cannot be longer than 128 characters: %q", k, value))
}
// http://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html
pattern := `^[a-zA-Z0-9$_]+$`
pattern := `^[a-zA-Z0-9$_-]+$`
if !regexp.MustCompile(pattern).MatchString(value) {
errors = append(errors, fmt.Errorf(
"%q doesn't comply with restrictions (%q): %q",
Expand Down
2 changes: 2 additions & 0 deletions builtin/providers/aws/validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ func TestValidateLambdaQualifier(t *testing.T) {
"prod",
"PROD",
"MyTestEnv",
"contains-dashes",
"contains_underscores",
"$LATEST",
}
for _, v := range validNames {
Expand Down

0 comments on commit e3c89da

Please sign in to comment.