I am currently using an AWS Lambda to initiate a maintenance window, but have found that the Execution Timeout is default set to 3600 (1hour), when this is used on a larger scale 1 hour tends to drag on a bit. I am attempted to lower the timeout to 900 (15mins), but although executionTimeout: ["900"] is accepted when I run the lambda, The maintenance window is created and I get the error in the execution tasks: FAILED: "The specified parameters are incomplete or invalid."
here is the snippet of code I am attempting:
reg_taskmw_res = ssm_client.register_task_with_maintenance_window(
WindowId=window_id,
Targets=[
{
'Key': 'WindowTargetIds',
'Values': [
reg_targetmw_res['WindowTargetId']
]
},
],
TaskArn='AWS-RunPatchBaseline',
TaskType='RUN_COMMAND',
TaskInvocationParameters={
'RunCommand': {
'DocumentHash': DocHash,
'DocumentHashType': 'Sha256',
'Parameters': {
'Operation': ['Scan'],
'executionTimeout': ['900']
},
'TimeoutSeconds': 60
},
},
Priority=123,
MaxConcurrency='3',
MaxErrors='3'
)
If I don't use the executionTimeout the maintenance window works, but with a 3600 timeout. I have tried multiple ways of doing this and search for ages to no avail. Thanks for all your help!