Skip to content

Commit 70857bd

Browse files
authored
Find in maps can return arrays (#2845)
1 parent 3a362b6 commit 70857bd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cfnlint/template/transforms/_language_extensions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# initializing size of string
2323
_N = 7
2424

25-
_SCALAR_TYPES = (str, int, float)
25+
_SCALAR_TYPES = (str, int, float, bool)
2626

2727

2828
class _ResolveError(Exception):
@@ -159,7 +159,7 @@ def _walk(self, item: Any, params: MutableMapping[str, Any], cfn: Any):
159159
if map_value is None:
160160
continue
161161
# if we can resolve it we will return it
162-
if isinstance(map_value, _SCALAR_TYPES):
162+
if isinstance(map_value, tuple([list]) + _SCALAR_TYPES):
163163
return map_value
164164
except Exception as e: # pylint: disable=broad-exception-caught
165165
# We couldn't resolve the FindInMap so we are going to leave it as it is
@@ -293,7 +293,6 @@ def value(
293293
params = {}
294294
t_map = deepcopy(self._map)
295295
mapping = None
296-
297296
try:
298297
mapping = cfn.template.get("Mappings", {}).get(
299298
t_map[0].value(cfn, params, only_params)

0 commit comments

Comments
 (0)