Skip to content

Commit

Permalink
Merge pull request #5935 from ethangunderson/master
Browse files Browse the repository at this point in the history
Redshift master usernames may contain underscores
  • Loading branch information
stack72 committed Mar 31, 2016
2 parents 89f65a3 + 1c5c58d commit 9d49c54
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 9d49c54

Please sign in to comment.