Miguel Garcia
Miguel Garcia

Reputation: 35

SSM Automation Run Command is not longer than default 3600 seconds

I have been working with AWS Systems Manager and I have created a Document to run a command, But it appears there is no way to overwrite the timeout for a run command in an SSM

I have changed the execution timeout here in the parameters but does not work. enter image description here

also, I added a timeoutSeconds in my Document and it doesn't work either.

This is my Document (I'm using schema version 2.2):

schemaVersion: "2.2"
description: "Runs a Python command"
parameters:
  Params:
    type: "String"
    description: "Params after the python3 keyword."
mainSteps:
- action: "aws:runShellScript"
  name: "Python3"
  inputs:
    timeoutSeconds: '300000'
    runCommand:
      - "sudo /usr/bin/python3 /opt/python/current/app/{{Params}}"

Upvotes: 2

Views: 5343

Answers (2)

Mark Dai
Mark Dai

Reputation: 11

    timeoutSeconds: '300000'

Isn't this string but not integer?

Upvotes: 1

Dennis Traub
Dennis Traub

Reputation: 51634

1: The setting that’s displayed in your screenshot in the Other parameters section is the Delivery Timeout, which is different from the execution timeout.

You must specify the execution timeout value in the Execution Timeout field, if available. Not all SSM documents require that you specify an execution timeout. If a Systems Manager document doesn't require that you explicitly specify an execution timeout value, then Systems Manager enforces the hard-coded default execution timeout.

2: In your document, the timeoutSeconds attribute is in the wrong place. It needs to be on the same level as the action.

...
mainSteps:
- action: "aws:runShellScript"
  timeoutSeconds: 300000
  name: "Python3"
  inputs:
    runCommand:
    - "sudo /usr/bin/python3 /opt/python/current/app/{{Params}}"

Upvotes: 1

Related Questions