跳至内容

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?

已提问 9 年前7767 查看次数

5 回答
2

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!

已回答 8 年前

  • thank you so much for the answer really helped me

  • Thank you so much. The documentation needs a revamp

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

已回答 9 年前

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.

已回答 9 年前

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?

已回答 8 年前

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!

已回答 8 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。