cloudtools/troposphere — pull request #82 by andystanton (2014-05-23 12:46:09+00:00)
Title: Allow autoscaling group to support 'min instances in service' and 'max size' values that are Refs

### Background

I have a requirement that the Autoscaling Group 'Max Size' and its Update Policy's 'Min Instances In Service' should be able to be supplied as parameters. This means that instead of passing in ints, I need to pass in Refs.

### Issue

The validation check for AutoScalingGroup assumes that both values can be cast to int, and this causes a TypeError when rendering the template as json.

### Solution

Before writing a fix, I added two unit tests that make sure ASG's validate method runs successfully if either MinInstancesInService or MaxSize are Ref objects rather than ints.

I then updated the type of AutoScalingGroup's MaxSize property to be 'basestring' in line with other properties that accept Ref values.

Finally I added a check in AutoScalingGroup's validate method that bypasses the numeric comparison if either MinInstancesInService or MaxSize are Ref objects rather than ints.