![]() In this case we go for an “Automation task”. ![]() Attaching a task can be done in the task section of the maintenance window: Until now we only specified a time to run something but we did not specify what to run. ![]() Once the maintenance window is created we need to attach a task to it. Of course it needs a name and an optional description:Īgain, in this example, we use a cron expression for the scheduling (some as above in the CloudWatch example). The first step is to create a new maintenance window: executing something before doing the reboot and do something else after the reboot. It requires a bit more preparation work but in the end this is the solution we decided to go for as more instances can be scheduled with one maintenance window (up to 50) and you could combine several tasks, e.g. The other solution for scheduling stuff against many instances is to use AWS SSM. Once time reaches your cron expression target the instance(s) will reboot. You should pre-create an IAM role with sufficient permissions which you can use for this as otherwise a new one will be created each time.įinally give a name and a description, that’s it: If you need more then you have to use System Manager as described later in this post. There is one limitation: You can only add up to five targets. Select the “EC2 RebootInstances API call” and provide the instance IDs you want to have rebooted. Go for “Schedule” and give a cron expression. You could, of course, do that as well by using cron and the AWS command line utilities but this is not the scope of this post.įor CloudWatch the procedure for rebooting instances is the following: Create a new rule: In this post we will only look at CloudWatch and System Manager as these two can be used to schedule the reboot easily using AWS native utilities. #Aws auto shutdown timer windows#If you want to schedule a reboot you can either do that using CloudWatch or you can use SSM Maintenance Windows for that. You can use the AWS command line utilities as well. ![]() Rebooting an AWS instance can be done in several ways: You can of course do that directly from the AWS console. Maye you applied some patches or for whatever reason. From time to time you might require to reboot your AWS instances. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |