6
6
import regex as re
7
7
8
8
from cfnlint ._typing import RuleMatches
9
+ from cfnlint .helpers import VALID_PARAMETER_TYPES_LIST
9
10
from cfnlint .rules import CloudFormationLintRule , RuleMatch
10
11
from cfnlint .template import Template
11
12
@@ -127,8 +128,8 @@ def match_default_value(self, paramname, paramvalue, default_value):
127
128
matches .extend (self .check_max_length (default_value , max_length , path ))
128
129
return matches
129
130
130
- def is_cdl (self , paramvalue ):
131
- return paramvalue .get ("Type" ) == "CommaDelimitedList"
131
+ def is_list (self , paramvalue ):
132
+ return paramvalue .get ("Type" ) in VALID_PARAMETER_TYPES_LIST
132
133
133
134
def match (self , cfn : Template ) -> RuleMatches :
134
135
matches = []
@@ -137,7 +138,7 @@ def match(self, cfn: Template) -> RuleMatches:
137
138
param_cdl_matches = []
138
139
param_matches = []
139
140
default_value = paramvalue .get ("Default" )
140
- if default_value is not None and self .is_cdl (paramvalue ):
141
+ if default_value is not None and self .is_list (paramvalue ):
141
142
comma_delimited_default_values = [
142
143
x .strip () for x in default_value .split ("," )
143
144
]
@@ -146,7 +147,7 @@ def match(self, cfn: Template) -> RuleMatches:
146
147
self .match_default_value (paramname , paramvalue , value )
147
148
)
148
149
149
- if param_cdl_matches or not self .is_cdl (paramvalue ):
150
+ if param_cdl_matches or not self .is_list (paramvalue ):
150
151
param_matches .extend (
151
152
self .match_default_value (paramname , paramvalue , default_value )
152
153
)
0 commit comments