How to temporarily turn off a rule?

Hi @Nicolas_Harraudeau

Apologies for the late reply to your reply!

With regards to your question, first I should explain that I’m not the strongest Python programmer, so there may well be a better way of doing things, but this is how my code stands at the moment:

def register_task_with_maintenance_window(
       profile_name, region, window_id, targets,
       task_arn, service_role_arn, task_type,
       task_invocation_parameters, max_concurrency,
       max_errors, task_name):
   ssm = get_ssm_client(profile_name, region)
   ssm.register_task_with_maintenance_window(
       WindowId=window_id,
       Targets=targets,
       TaskArn=task_arn,
       ServiceRoleArn=service_role_arn,
       TaskType=task_type,
       TaskInvocationParameters=task_invocation_parameters,
       MaxConcurrency=max_concurrency,
       MaxErrors=max_errors,
       Name=task_name
   )

ssm.register_task_with_maintenance_window is a library call provided by AWS as part of their Boto library, so I have no control over that.

The reason for the function is because I’ve separated out all of the AWS calls in my code into a separate module, so the “parent” code has no direct AWS calls itself.

If there is a Pythonic way of safely reducing the number of parameters to the function without making it too hard to read and understand, I’d be up for learning :slight_smile:

Thank you.