Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::ElasticLoadBalancingV2::LoadBalancer can not use AWSHelperFn for Subnets and SecurityGroups #1773

Open
kteague opened this issue Aug 26, 2020 · 0 comments

Comments

@kteague
Copy link
Contributor

kteague commented Aug 26, 2020

The 2020-06-11 change to Troposphere changed props for AWS::ElasticLoadBalancingV2::LoadBalancer SecurityGroups and Subnets from:

'Subnets': (list, False), -- to --> 'Subnets': ([basestring], False),

4d404fa

If you create a troposphere.elasticloadbalancingv2.LoadBalancer using from_dict the _from_dict validation is now triggered to check for a List. However, if you are using a AwsHelperFn such as a Troposphere.Ref for List<AWS::EC2::Subnet::Id> and List<AWS::EC2::SecurityGroup::Id> then validation will incorrectly fail.

Changing BaseAWSObject._from_dict from:

if isinstance(prop_type, list):

To

if isinstance(prop_type, list) and not isinstance(value, AWSHelperFn):

Fixes the problem by skipping validation on AWSHelperFn's. Basically bringing the validation in-sync with the behaviour of the BaseAWSObject.__setattr__ method.

Not sure if there are other considerations that change might have though ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant