Skip to content

Commit

Permalink
Merge pull request #2520 from TimeIncOSS/f-aws-asg-validation
Browse files Browse the repository at this point in the history
provider/aws: Add validation for aws_autoscaling_group.name
  • Loading branch information
radeksimko committed Jun 26, 2015
2 parents b0d6dc3 + 23459ec commit 685ca37
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions builtin/providers/aws/resource_aws_autoscaling_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ func resourceAwsAutoscalingGroup() *schema.Resource {
Type: schema.TypeString,
Required: 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{
Expand Down

0 comments on commit 685ca37

Please sign in to comment.