From b74a6144e1570e0eb6430400d1ba1728198626e2 Mon Sep 17 00:00:00 2001 From: yzach Date: Wed, 1 Nov 2017 10:36:37 +0200 Subject: [PATCH] validateBatchName should allow hyphens Links to AWS docs http://docs.aws.amazon.com/batch/latest/APIReference/API_CreateComputeEnvironment.html#Batch-CreateComputeEnvironment-request-computeEnvironmentName http://docs.aws.amazon.com/batch/latest/APIReference/API_RegisterJobDefinition.html#Batch-RegisterJobDefinition-request-jobDefinitionName --- aws/validators.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/validators.go b/aws/validators.go index 44acd2cf1a6..14b48919b1a 100644 --- a/aws/validators.go +++ b/aws/validators.go @@ -1490,8 +1490,8 @@ func validateSsmParameterType(v interface{}, k string) (ws []string, errors []er func validateBatchName(v interface{}, k string) (ws []string, errors []error) { value := v.(string) - if !regexp.MustCompile(`^[A-Za-z0-9_]{1,128}$`).MatchString(value) { - errors = append(errors, fmt.Errorf("%q (%q) must be up to 128 letters (uppercase and lowercase), numbers, and underscores.", k, v)) + if !regexp.MustCompile(`^[A-Za-z0-9_-]{1,128}$`).MatchString(value) { + errors = append(errors, fmt.Errorf("%q (%q) must be up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores.", k, v)) } return }