Redshift master usernames may contain underscores

This commit is contained in:
Ethan Gunderson 2016-03-30 17:22:15 -05:00
parent c6b768eaa5
commit 1c5c58d072
2 changed files with 5 additions and 1 deletions

View File

@ -579,7 +579,7 @@ func validateRedshiftClusterFinalSnapshotIdentifier(v interface{}, k string) (ws
func validateRedshiftClusterMasterUsername(v interface{}, k string) (ws []string, errors []error) { func validateRedshiftClusterMasterUsername(v interface{}, k string) (ws []string, errors []error) {
value := v.(string) value := v.(string)
if !regexp.MustCompile(`^[A-Za-z0-9]+$`).MatchString(value) { if !regexp.MustCompile(`^\w+$`).MatchString(value) {
errors = append(errors, fmt.Errorf( errors = append(errors, fmt.Errorf(
"only alphanumeric characters in %q", k)) "only alphanumeric characters in %q", k))
} }

View File

@ -257,6 +257,10 @@ func TestResourceAWSRedshiftClusterMasterUsernameValidation(t *testing.T) {
Value: randomString(129), Value: randomString(129),
ErrCount: 1, ErrCount: 1,
}, },
{
Value: "testing_testing123",
ErrCount: 0,
},
} }
for _, tc := range cases { for _, tc := range cases {