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
posta 4 mesi fa431 visualizzazioni
2 Risposte
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
con risposta 4 mesi fa
  • 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
con risposta 4 mesi fa
profile picture
ESPERTO
verificato un mese fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande