SSM Automation Run Command longer than default 3600 seconds

0

Currently, it appears there is no way to overwrite the timeout for a run command in an SSM automation:

{
"name": "LongRunningCommand",
"action": "aws:runCommand",
"inputs": {
"DocumentName": "AWS-RunPowerShellScript",
"InstanceIds": ["i-1234567890abcdef0"],
"Parameters": {
"commands": "Sleep(3601) ",
--"timeoutSeconds": "4000"--
}
}
}

The runCommand must finish in under 3600 or it times out. Is there a workaround?

asked 5 years ago466 views
5 Answers
1

I had issues with AWS Data Pipeline RunShellScript send commands timing out after an hour (default 3600 seconds) when I upgraded the SSM agent on my Linux EC2 instance to the latest version. The solution was to change the parameters.

Original:

--parameters commands=["python my_script.py"]

New (with 9999 second timeout):

--parameters '{"workingDirectory":["path/to/my/script"],"executionTimeout":["9999"],"commands":["python my_script.py"]}'

The AWS documentation around this is very poor but I managed to figure it out by creating a Run Command in the AWS Systems Manager console. Once you've input all the settings you want just scroll to the "AWS command line interface command" section at the bottom and you can copy the code from there into CLI, Data Pipeline or wherever else you want to run it. Hope this helps someone!

answered 4 years ago
  • thank you so much for the answer really helped me

0

Hello,

You need to change "Execution Timeout" parameters when you use Run Command utility to override the default 3600 Second value of the Execution Timeout.
Below document provides a step by step guide for it:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/tutorial_run_command.html#rc-tutorial-ui

Regards,
Santosh K

answered 5 years ago
0

Perhaps you missed my question. This is regarding an SSM Automation, not just the Run Command. I want to change the Execution Timeout in an Automation SSM Document.

answered 5 years ago
0

Is anyone going to respond to this question? I'm also hitting problems with the fact that this value is only configurable in the Run Command web UI, not in SSM Automation, the AWS CLI, or or in boto3.

I know I'm not alone in saying that I use the console to prototype before automating. Effectively, this limitation means everyone who uses this and requires a moderate command timeout (like 90 minutes, which is my use case) will hit this blocker.

When can we expect a fix?

answered 4 years ago
0

Thank you tobyayre! That did the trick.

It seems confusing to me that an execution timeout would be tied to a document type, as it would seem to be universal. But that appears to the case; knowing where to look I found this documentation on document specific parameters: https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-doc-syntax.html

Thanks again!

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions