Skip to content

Commit

Permalink
Find in maps can return arrays (#2845)
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong authored Aug 14, 2023
1 parent 3a362b6 commit 70857bd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cfnlint/template/transforms/_language_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# initializing size of string
_N = 7

_SCALAR_TYPES = (str, int, float)
_SCALAR_TYPES = (str, int, float, bool)


class _ResolveError(Exception):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 70857bd

Please sign in to comment.