11
11
12
12
import regex as re
13
13
14
- from cfnlint .helpers import AVAILABILITY_ZONES , REGEX_SUB_PARAMETERS
14
+ from cfnlint .helpers import (
15
+ AVAILABILITY_ZONES ,
16
+ PSEUDOPARAMS ,
17
+ REGEX_SUB_PARAMETERS ,
18
+ is_function ,
19
+ )
15
20
from cfnlint .jsonschema import ValidationError , Validator
16
21
from cfnlint .jsonschema ._typing import ResolutionResult
17
22
from cfnlint .jsonschema ._utils import equal
@@ -69,6 +74,9 @@ def find_in_map(validator: Validator, instance: Any) -> ResolutionResult:
69
74
mappings = list (validator .context .mappings .maps .keys ())
70
75
results = []
71
76
found_valid_combination = False
77
+ k , v = is_function (instance [0 ])
78
+ if k == "Ref" and v in PSEUDOPARAMS :
79
+ return
72
80
for map_name , map_v , _ in validator .resolve_value (instance [0 ]):
73
81
if not validator .is_type (map_name , "string" ):
74
82
continue
@@ -90,6 +98,9 @@ def find_in_map(validator: Validator, instance: Any) -> ResolutionResult:
90
98
if validator .context .mappings .maps [map_name ].is_transform :
91
99
continue
92
100
101
+ k , v = is_function (instance [1 ])
102
+ if k == "Ref" and v in PSEUDOPARAMS :
103
+ continue
93
104
for top_level_key , top_v , _ in validator .resolve_value (instance [1 ]):
94
105
if validator .is_type (top_level_key , "integer" ):
95
106
top_level_key = str (top_level_key )
@@ -123,6 +134,9 @@ def find_in_map(validator: Validator, instance: Any) -> ResolutionResult:
123
134
):
124
135
continue
125
136
137
+ k , v = is_function (instance [2 ])
138
+ if k == "Ref" and v in PSEUDOPARAMS :
139
+ continue
126
140
for second_level_key , second_v , err in validator .resolve_value (instance [2 ]):
127
141
if validator .is_type (second_level_key , "integer" ):
128
142
second_level_key = str (second_level_key )
0 commit comments