Handle AWS list functions in template generator - #2331
Conversation
The template generator would introduce a list wrapping for AWS Functions (Cidr, GetAZs, Split) that return a list resulting in the function results wrapped in a list. This detects and corrects that behavior.
|
As far as I can judge, this does what is expected. Due to lack of familiarity with the code-base however, I'm unsure if it has any unwanted side-effects in areas I'm not aware of. |
| ) | ||
| from troposphere.policies import CreationPolicy, UpdatePolicy | ||
|
|
||
| AWS_LIST_RETURN_FUNCTIONS = (Cidr, GetAZs, Split) |
There was a problem hiding this comment.
Might be a bit philosophical, but should we prevent any function that have the potential of returning a list from being wrapped?
For example, the following ones have the potential of returning a list:
FindInMapGetAttSelect
However, I think the current approach is a good start, as it prevents wrapping of functions which we are certain to return a list in all use cases.
There was a problem hiding this comment.
Thank you for the review. Since it is targeted it should not cause regressions and the tests do run over all the examples so I think we're good there as well. I'm going to commit this now.
The template generator would introduce a list wrapping for AWS Functions (Cidr, GetAZs, Split) that return a list resulting in the function results wrapped in a list. This detects and corrects that behavior.
@ilons I expanded the scope of your patch to include other functions and added a test. Could you review, test, and approve?
Fixes #2162