provider-aws: validate cluster_id length for aws_elasticache_cluster (#6330)

This commit is contained in:
lian 2016-04-25 21:53:31 +02:00 committed by Paul Stack
parent 7a4bf6ae47
commit a443144c89
1 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,14 @@ func resourceAwsElasticacheCluster() *schema.Resource {
// with non-converging diffs.
return strings.ToLower(val.(string))
},
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
value := v.(string)
if (len(value) < 1) || (len(value) > 20) {
errors = append(errors, fmt.Errorf(
"%q must contain from 1 to 20 alphanumeric characters or hyphens", k))
}
return
},
},
"configuration_endpoint": &schema.Schema{
Type: schema.TypeString,