AutoScalingGroup MinSize and MaxSize do not allow use of Select intrinsic function
I am trying to consolidate the ASG Min, Max, and Desired values into a single parameter, and I am hitting an error. I have the parameter formatted as a list of | delimited values, and I am using Select and Split to separate the items. I currently have the following values set for three properties:
MinSize=Select(0, Split("|", Ref(scaling_settings))),
MaxSize=Select(2, Split("|", Ref(scaling_settings))),
DesiredCapacity=Select(1, Split("|", Ref(scaling_settings))),
When trying to generate the template, I am hitting the following error:
...
File "c:\python27\lib\site-packages\troposphere\__init__.py", line 556, in to_dict
return encode_to_dict(t)
File "c:\python27\lib\site-packages\troposphere\__init__.py", line 61, in encode_to_dict
props[name] = encode_to_dict(prop)
File "c:\python27\lib\site-packages\troposphere\__init__.py", line 61, in encode_to_dict
props[name] = encode_to_dict(prop)
File "c:\python27\lib\site-packages\troposphere\__init__.py", line 52, in encode_to_dict
return encode_to_dict(obj.to_dict())
File "c:\python27\lib\site-packages\troposphere\__init__.py", line 206, in to_dict
self.validate()
File "c:\python27\lib\site-packages\troposphere\autoscaling.py", line 146, in validate
max_count = int(self.MaxSize)
RuntimeError: Failed to build JSON for template <TemplateName>: int() argument must be a string or a number, not 'Select'
It appears only the If, FindInMap, and Ref functions are currently allowed. I would like to propose adding Select to the allowed functions for the MinSize and MaxSize properties as well.
@phobologic any reason why these checks shouldn't just be checking against AWSHelperFn? https://github.com/cloudtools/troposphere/blob/master/troposphere/autoscaling.py#L138
I can't think of one, not sure why we only did the specific functions in the first place.