Merge pull request #2520 from TimeIncOSS/f-aws-asg-validation

provider/aws: Add validation for aws_autoscaling_group.name
This commit is contained in:
Radek Simko 2015-06-26 15:53:14 +01:00
commit 685ca374dc
1 changed files with 9 additions and 0 deletions

View File

@ -27,6 +27,15 @@ func resourceAwsAutoscalingGroup() *schema.Resource {
Type: schema.TypeString, Type: schema.TypeString,
Required: true, Required: true,
ForceNew: true, ForceNew: true,
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
// https://github.com/boto/botocore/blob/9f322b1/botocore/data/autoscaling/2011-01-01/service-2.json#L1862-L1873
value := v.(string)
if len(value) > 255 {
errors = append(errors, fmt.Errorf(
"%q cannot be longer than 255 characters", k))
}
return
},
}, },
"launch_configuration": &schema.Schema{ "launch_configuration": &schema.Schema{