[英]aws autoscaling group ec2 instance to run script every minute
I want to have my ec2 instances to start running some automation script within the server once they are launched in the auto scaling group.我想让我的 ec2 实例在 Auto Scaling 组中启动后开始在服务器中运行一些自动化脚本。 This script will need to run every minute so userdata is probably not a good option.
该脚本需要每分钟运行一次,因此 userdata 可能不是一个好的选择。 I wonder if there is a way to do this with ssm document.
我想知道是否有办法用 ssm 文档做到这一点。 Any ideas would be much appreciated!
任何想法将不胜感激!
Do you need to store the logs of the script on either S3 or Cloudwatch?您是否需要将脚本日志存储在 S3 或 Cloudwatch 上? Then use an EventBridge rule and a SSM Run Command document.
然后使用 EventBridge 规则和 SSM 运行命令文档。
Do you not care about such logs?你不关心这样的日志吗? Then use your operating system native tools: cron on Linux or task scheduler on Windows.
然后使用您的操作系统本机工具:Linux 上的 cron 或 Windows 上的任务调度程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.