@@ -20,13 +20,18 @@ def match(self, cfn):
20
20
path = ecs_service ["Path" ]
21
21
properties = ecs_service ["Value" ]
22
22
if isinstance (properties , dict ):
23
- launch_type = properties .get ("LaunchType" , None )
24
- if isinstance (launch_type , str ) and launch_type == "Fargate" :
25
- scheduling_strategy = properties .get ("SchedulingStrategy" , None )
26
- if (
27
- isinstance (scheduling_strategy , str )
28
- and scheduling_strategy != "REPLICA"
29
- ):
30
- error_message = f"Fargate service only support REPLICA as scheduling strategy at { '/' .join (map (str , path ))} "
31
- matches .append (RuleMatch (path , error_message ))
23
+ scenarios = cfn .get_object_without_conditions (
24
+ properties , ["LaunchType" , "SchedulingStrategy" ]
25
+ )
26
+ for scenario in scenarios :
27
+ props = scenario .get ("Object" )
28
+ launch_type = props .get ("LaunchType" , None )
29
+ if isinstance (launch_type , str ) and launch_type == "FARGATE" :
30
+ scheduling_strategy = props .get ("SchedulingStrategy" , None )
31
+ if (
32
+ isinstance (scheduling_strategy , str )
33
+ and scheduling_strategy != "REPLICA"
34
+ ):
35
+ error_message = f"Fargate service only support REPLICA as scheduling strategy at { '/' .join (map (str , path ))} "
36
+ matches .append (RuleMatch (path , error_message ))
32
37
return matches
0 commit comments