From bd22a4f65a6a37ee371cbeedf01415a8e7c4514f Mon Sep 17 00:00:00 2001 From: Alexander Zhukau Date: Sun, 14 Aug 2016 16:57:44 -0400 Subject: [PATCH] provider/aws: allow numeric characters in RedshiftClusterDbName (#8178) --- builtin/providers/aws/resource_aws_redshift_cluster.go | 4 ++-- builtin/providers/aws/resource_aws_redshift_cluster_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/providers/aws/resource_aws_redshift_cluster.go b/builtin/providers/aws/resource_aws_redshift_cluster.go index af6eda093b..3273b639b8 100644 --- a/builtin/providers/aws/resource_aws_redshift_cluster.go +++ b/builtin/providers/aws/resource_aws_redshift_cluster.go @@ -750,9 +750,9 @@ func validateRedshiftClusterIdentifier(v interface{}, k string) (ws []string, er func validateRedshiftClusterDbName(v interface{}, k string) (ws []string, errors []error) { value := v.(string) - if !regexp.MustCompile(`^[a-z]+$`).MatchString(value) { + if !regexp.MustCompile(`^[0-9a-z]+$`).MatchString(value) { errors = append(errors, fmt.Errorf( - "only lowercase letters characters allowed in %q", k)) + "only lowercase letters and numeric characters allowed in %q", k)) } if len(value) > 64 { errors = append(errors, fmt.Errorf( diff --git a/builtin/providers/aws/resource_aws_redshift_cluster_test.go b/builtin/providers/aws/resource_aws_redshift_cluster_test.go index 4be682136b..903278c88a 100644 --- a/builtin/providers/aws/resource_aws_redshift_cluster_test.go +++ b/builtin/providers/aws/resource_aws_redshift_cluster_test.go @@ -319,7 +319,7 @@ func TestResourceAWSRedshiftClusterDbNameValidation(t *testing.T) { }, { Value: "testing1", - ErrCount: 1, + ErrCount: 0, }, { Value: "testing-",