From 70857bdda976f7222cf11d60a82752bb63a15efa Mon Sep 17 00:00:00 2001 From: Kevin DeJong Date: Mon, 14 Aug 2023 09:51:10 -0700 Subject: [PATCH] Find in maps can return arrays (#2845) --- src/cfnlint/template/transforms/_language_extensions.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cfnlint/template/transforms/_language_extensions.py b/src/cfnlint/template/transforms/_language_extensions.py index 2d7577b4fb..3d2f713bdf 100644 --- a/src/cfnlint/template/transforms/_language_extensions.py +++ b/src/cfnlint/template/transforms/_language_extensions.py @@ -22,7 +22,7 @@ # initializing size of string _N = 7 -_SCALAR_TYPES = (str, int, float) +_SCALAR_TYPES = (str, int, float, bool) class _ResolveError(Exception): @@ -159,7 +159,7 @@ def _walk(self, item: Any, params: MutableMapping[str, Any], cfn: Any): if map_value is None: continue # if we can resolve it we will return it - if isinstance(map_value, _SCALAR_TYPES): + if isinstance(map_value, tuple([list]) + _SCALAR_TYPES): return map_value except Exception as e: # pylint: disable=broad-exception-caught # We couldn't resolve the FindInMap so we are going to leave it as it is @@ -293,7 +293,6 @@ def value( params = {} t_map = deepcopy(self._map) mapping = None - try: mapping = cfn.template.get("Mappings", {}).get( t_map[0].value(cfn, params, only_params)