Skip to content

AutoScalingGroup MinSize and MaxSize do not allow use of Select intrinsic function #753

@johnctitus

Description

@johnctitus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions