cloudtools / cloudtools/troposphere
AWS::ElasticLoadBalancingV2::LoadBalancer can not use AWSHelperFn for Subnets and SecurityGroups
- Dominant language
- Python
- Stars
- 4.9k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
The 2020-06-11 change to Troposphere changed props for AWS::ElasticLoadBalancingV2::LoadBalancer SecurityGroups and Subnets from:
`'Subnets': (list, False),` -- to --> `'Subnets': ([basestring], False),`
https://github.com/cloudtools/troposphere/commit/4d404fafd001f3d01c4bbd2dc322d143f5975143
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` and `List` 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 ...
Contributor guide
Assessment
This issue has not been assessed yet.