Skip to content

Commit

Permalink
Redshift master usernames may contain underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan Gunderson committed Mar 30, 2016
1 parent c6b768e commit dbdfc8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/providers/aws/resource_aws_redshift_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ func validateRedshiftClusterFinalSnapshotIdentifier(v interface{}, k string) (ws

func validateRedshiftClusterMasterUsername(v interface{}, k string) (ws []string, errors []error) {
value := v.(string)
if !regexp.MustCompile(`^[A-Za-z0-9]+$`).MatchString(value) {
if !regexp.MustCompile(`^\w+$`).MatchString(value) {
errors = append(errors, fmt.Errorf(
"only alphanumeric characters in %q", k))
}
Expand Down
4 changes: 4 additions & 0 deletions builtin/providers/aws/resource_aws_redshift_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ func TestResourceAWSRedshiftClusterMasterUsernameValidation(t *testing.T) {
Value: randomString(129),
ErrCount: 1,
},
{
Value: "testing_testing123",
ErrCount: 0,
},
}

for _, tc := range cases {
Expand Down

0 comments on commit dbdfc8d

Please sign in to comment.