diff --git a/builtin/providers/aws/resource_aws_redshift_cluster.go b/builtin/providers/aws/resource_aws_redshift_cluster.go index b77f0527f..f648a95eb 100644 --- a/builtin/providers/aws/resource_aws_redshift_cluster.go +++ b/builtin/providers/aws/resource_aws_redshift_cluster.go @@ -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)) } diff --git a/builtin/providers/aws/resource_aws_redshift_cluster_test.go b/builtin/providers/aws/resource_aws_redshift_cluster_test.go index 938d5c7a5..93bf29c54 100644 --- a/builtin/providers/aws/resource_aws_redshift_cluster_test.go +++ b/builtin/providers/aws/resource_aws_redshift_cluster_test.go @@ -257,6 +257,10 @@ func TestResourceAWSRedshiftClusterMasterUsernameValidation(t *testing.T) { Value: randomString(129), ErrCount: 1, }, + { + Value: "testing_testing123", + ErrCount: 0, + }, } for _, tc := range cases {