Home > Back-end >  aws autoscaling group ec2 instance to run script every minute
aws autoscaling group ec2 instance to run script every minute

Time:08-27

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. This script will need to run every minute so userdata is probably not a good option. I wonder if there is a way to do this with ssm document. Any ideas would be much appreciated!

CodePudding user response:

Do you need to store the logs of the script on either S3 or Cloudwatch? Then use an EventBridge rule and a SSM Run Command document.

Do you not care about such logs? Then use your operating system native tools: cron on Linux or task scheduler on Windows.

  • Related