- Newest
- Most votes
- Most comments
Hello,
The Execution timeout value is passed to the command plugin using input parameter "timeoutSeconds" as shown in below SSM document:
- action: aws:runShellScript
name: Sleep2M
inputs:
runCommand:
- "echo \"Testing timeout\""
- "sleep 60"
timeoutSeconds: '180' <------- This is execution timeout
The "TimeoutSeconds" parameter in MaintenanceWindowRunCommandParameters API is the Delivery timeout value.
To answer your queries,
1. If I modify timeoutSeconds, this will increase the overall time of the invocation, but will this impact the underlying executions if for example, a server gets locked up.
- If you specify the "timeoutSeconds" value present in the "MaintenanceWindowRunCommandParameters" API, then Delivery Timeout will increase thereby increasing the Total Timeout [Eg:- 800 (DeliveryTimeout) + 3600 (ExecutionTimeout) = 4400 seconds). It will never increase the time for the command to complete (Execution Timeout)]. As soon as long instance is reporting to SSM, then there should be no issues even if server/user is logged out.
2. How, using the CDK do you expose the Execution Timeout? The documentation is not clear how this is implemented within a Maintenance Window Task Invocation.
- We do not specifically expose Execution Timeout value through the API however you can build your SSM document to include Execution Timeout as a parameter and provide its value through the "MaintenanceWindowRunCommandParameters" API via Parameters syntax.
Example:
"parameters": {
"executionTimeout": {
"type": "String",
"description": "(Optional) The time in seconds for a command to be completed before it is considered to have failed.",
"allowedPattern": "([1-9][0-9]{0,4})|(1[0-6][0-9]{4})|(17[0-1][0-9]{3})|(172[0-7][0-9]{2})|(172800)"
}
},
"mainSteps": [
{
"action": "aws:runShellScript",
"name": "Sleep2M",
"inputs": {
"runCommand": "{{ commands }}",
"timeoutSeconds": "{{ executionTimeout }}"
}
]
The {{ executionTimeout }} parameter value of the document can be provided through "MaintenanceWindowRunCommandParameters" API in the CDK application/code as shown below:
Example:
const TaskInvocationParameters= {
maintenanceWindowRunCommandParameters: {
parameters: {
executionTimeout : ["3000"] <--- Here, you can specify the execution timeout value which will be fed into the document plugin
},
},
};
Relevant content
- asked a year ago
- asked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago