amazon-web-services - SSM 自动化运行命令不超过默认 3600 秒
问题描述
我一直在使用 AWS Systems Manager,并且创建了一个文档来运行命令,但似乎无法覆盖 SSM 中运行命令的超时
另外,我在我的文档中添加了 timeoutSeconds ,它也不起作用。
这是我的文档(我使用的是架构版本 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}}"
解决方案
1:屏幕截图中其他参数部分显示的设置是Delivery Timeout,它与执行超时不同。
如果可用,您必须在执行超时字段中指定执行超时值。并非所有 SSM 文档都要求您指定执行超时。如果 Systems Manager 文档不要求您明确指定执行超时值,则 Systems Manager 会强制执行硬编码的默认执行超时。
2:在您的文档中,该timeoutSeconds
属性位于错误的位置。它需要与action
.
...
mainSteps:
- action: "aws:runShellScript"
timeoutSeconds: 300000
name: "Python3"
inputs:
runCommand:
- "sudo /usr/bin/python3 /opt/python/current/app/{{Params}}"
推荐阅读
- memory - 在微控制器中缓冲需要时钟周期吗?”
- python - 多指数汇总指标
- html - HTML RegEx(首字母大写)
- ruby-on-rails - Rails pg 数据库:schema_migrations 为空
- javascript - 如何从 XML 中选择随机子元素并显示子子元素;使用 JS?
- java - 需要能够使用遥控器导航软键盘
- php - 在一列中插入多个图像作为逗号分隔列表
- javascript - 在方法之间传递参数似乎并没有改变打字稿中的 agument
- amazon-web-services - 无服务器后端 (AWS) 的国际化
- mongodb - 根据其他集合数组中匹配的对象属性执行 $lookup