@@ -147,14 +147,14 @@ def create_maintenance_window(params: dict, account_id: str, regions: list) -> d
147
147
return {"window1_ids" : window1_ids , "window2_ids" : window2_ids , "window3_ids" : window3_ids }
148
148
149
149
150
- def define_mw_targets (params : dict , window1_id_response : list , window2_id_response : list , window3_id_response : list , account_id : str ) -> dict [str ,list ]:
150
+ def define_mw_targets (params : dict , win1_id_resp : list , win2_id_resp : list , win3_id_resp : list , account_id : str ) -> dict [str , list ]:
151
151
"""Define Maintenance Window Targets.
152
152
153
153
Args:
154
154
params (dict): Cloudformation Params
155
- window1_id_response (list): Previous Window 1 IDs for the Targets
156
- window2_id_response (list): Previous Window 2 IDs for the Targets
157
- window3_id_response (list): Previous Window 3 IDs for the Targets
155
+ win1_id_resp (list): Previous Window 1 IDs for the Targets
156
+ win2_id_resp (list): Previous Window 2 IDs for the Targets
157
+ win3_id_resp (list): Previous Window 3 IDs for the Targets
158
158
account_id (str): Account ID for the targets to live in
159
159
160
160
Returns:
@@ -168,7 +168,7 @@ def define_mw_targets(params: dict, window1_id_response: list, window2_id_respon
168
168
window1_targets = []
169
169
window2_targets = []
170
170
window3_targets = []
171
- for response in window1_id_response :
171
+ for response in win1_id_resp :
172
172
LOGGER .info (f"Maintenance Window Targets { response ['region' ]} " )
173
173
ssmclient = session .client ("ssm" , region_name = response ["region" ], config = boto3_config )
174
174
@@ -201,7 +201,7 @@ def define_mw_targets(params: dict, window1_id_response: list, window2_id_respon
201
201
"account_id" : account_id ,
202
202
}
203
203
)
204
- for response in window2_id_response :
204
+ for response in win2_id_resp :
205
205
LOGGER .info (f"Maintenance Window Targets { response ['region' ]} " )
206
206
# Window 2
207
207
target_name = params .get ("TARGET2_NAME" , "" )
@@ -228,7 +228,7 @@ def define_mw_targets(params: dict, window1_id_response: list, window2_id_respon
228
228
"account_id" : account_id ,
229
229
}
230
230
)
231
- for response in window3_id_response :
231
+ for response in win3_id_resp :
232
232
# Window 3
233
233
target_name = params .get ("TARGET3_NAME" , "" )
234
234
target_description = params .get ("TARGET3_DESCRIPTION" , "" )
@@ -257,7 +257,7 @@ def define_mw_targets(params: dict, window1_id_response: list, window2_id_respon
257
257
return {"window1_targets" : window1_targets , "window2_targets" : window2_targets , "window3_targets" : window3_targets }
258
258
259
259
260
- def def_mw_tasks ( params : dict , window_id_response : dict , window_target_response : dict , account_id : str ) -> dict : # noqa: CFQ001
260
+ def def_mw_tasks ( params : dict , window_id_response : dict , window_target_response : dict , account_id : str ) -> dict :# noqa: CFQ001, CCR001
261
261
"""Define maintenance window tasks.
262
262
263
263
Args:
@@ -459,7 +459,7 @@ def parameter_pattern_validator(parameter_name: str, parameter_value: str, patte
459
459
if not re .match (pattern , parameter_value ):
460
460
raise ValueError (f"'{ parameter_name } ' parameter with value of '{ parameter_value } ' does not follow the allowed pattern: { pattern } ." )
461
461
462
-
462
+ # noqa: CFQ001
463
463
def get_validated_parameters (
464
464
event : CloudFormationCustomResourceEvent ,
465
465
) -> dict : # noqa: CCR001 (cognitive complexity), CFQ001
@@ -698,10 +698,10 @@ def process_create_update_event(params: dict, regions: list) -> Dict:
698
698
all_window_ids .append (window_ids_raw ["window2_ids" ])
699
699
all_window_ids .append (window_ids_raw ["window3_ids" ])
700
700
window_target_response = define_mw_targets (
701
- params ,
702
- window_ids_raw ["window1_ids" ],
703
- window_ids_raw ["window2_ids" ],
704
- window_ids_raw ["window3_ids" ],
701
+ params ,
702
+ window_ids_raw ["window1_ids" ],
703
+ window_ids_raw ["window2_ids" ],
704
+ window_ids_raw ["window3_ids" ],
705
705
account_id )
706
706
all_window_targets .append (window_target_response )
707
707
all_window_tasks .append (def_mw_tasks (params , window_ids_raw , window_target_response , account_id ))
0 commit comments