AWS instance scheduler for maintenance windows: does (endtime) need to be after (begintime) to work? currently just stopping and not starting

0

Hello there, I'm trying to use scheduler to shutdown a box (on Tuesday of each week say) for an hour at 18:00 and then start it again the same day at 19:00 for a consistent backup before patching lets say. Does the <begintime> string have to be before the <endtime> for scheduler to work correctly? As it seems to work with 'office hours' i.e 'Turned on' at 9:00 'turned off' at 17:30 works. But when off at 18:00 and on at 19:00, it doesn't turn back on. I've also tried a separate schedule with just a shutdown (off at 18:00 Tuesday ) and a separate schedule to turn back on (on 19:00 tuesday ) but this also doesn't work. It just shutdown ok, but then doesn't turn on. Is it waiting until the next Tuesday? (i was trying with 3rd Tuesday of month but reduced to weekly as a test) The EC2 doesn't have an encrypted drive Any help would be amazing Thanks G

mrhyde
已提問 4 個月前檢視次數 432 次
2 個答案
0

Thank you both, appreciate the effort. Its a shame as I'm sure peeps would find it useful. I might go with trying the separate lambda first and see which ones least messy, but yes thanks for the logic on the Tuesdays timing, that could work. I'm doing this 3rd Tuesday of month etc, so I will have a play and see who wins :0) Anyone from AWS who wants a project ahem.. 'AWS maintenance scheduler' 'TM' Thanks G

mrhyde
已回答 4 個月前
  • If your use-case is narrow (just the one schedule/maintenance period), I would recommend investigating, in order of increasing complexity: EventBridge scheduled Rules, EventBridge Scheduler, or Resource Scheduler (SSM Quick Setup), before implementing something custom. Instance Scheduler is more appropriate if you need centrally managed schedules operating across accounts, regions, and services.

0

Yes, endtime must be after begintime. With the way one-sided periods currently work they are not really appropriate for designating a "not-running" period. You can get the behavior you want by thinking of the inverse of your "not-running" period. The running periods (which are what instance scheduler expects) are all days of the week except Tuesday, from 00:00 to 18:00 on Tuesday, and from 19:00 to 23:59 on Tuesday. With this approach Instance Scheduler will also start your instance at midnight.

AWS
已回答 4 個月前
profile picture
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南