Instance Scheduler adding new schedules

0

I have deployed AWS instance scheduler from Cloudformation and it is working fine when i have a period to start instance monday to friday at 8 and close at 7.

Now i am struggling in these three conditions.

  1. Some days on weekends i may need the instance to start and stop. Lets say i need a instance to start on some sunday that i know i will be working, can i schedule in such a way that on those specific days i can start and stop the instance through instance scheduler automatically without starting and stopping manually from my side. I dont want to change the existing period, i can add new period.

  2. Suppose there is a holiday and i want to stop a instance the whole day for that day, can i add specific dates to spot the instance? I tried this with a the following period but it didnot work

{
  "type": {
    "S": "period"
  },
  "name": {
    "S": "Holiday"
  },
  "begintime": {
    "S": "00:00"
  },
  "description": {
    "S": " holidays on October 10 and 11"
  },
  "endtime": {
    "S": "23:59"
  },
  "monthdays": {
    "SS": [
      "10",
      "11"
    ]
  },
  "months": {
    "SS": [
      "10"
    ]
  }
}

  1. I have configured the schedules tag key parameter to be "Schedule" where the schedule name is provided as parameter. Can i use other keys for Schedule at once? I have mandatory tag reguirement to use "Purpose" key and use the reason in which one of value "Test" for any instance creation. I want to stop the instance with "Test" after office hours on weekdays. Is it possible without deploying another instance scheduler?
1 Answer
0
Accepted Answer
  1. Yes, you can create a new period for specific weekend days without changing your existing weekday schedule. You can create a new period called "weekend-work" (or any name you prefer) and specify the exact dates you need the instance to run. For example, you could set up a period with specific monthdays and months for the Sundays you plan to work. Then, add this new period to your existing schedule. The Instance Scheduler will start and stop the instance automatically on those specified days.

  2. For holidays, you can indeed create a specific period to stop instances. However, the period you've shown is actually set to run the instance all day (from 00:00 to 23:59) on October 10th and 11th, rather than stopping it. To stop the instance on specific holidays, you should create a period without a begintime or endtime. This will ensure the instance remains stopped for the entire day. For example:

{
  "type": "period",
  "name": "Holiday",
  "description": "Holidays on October 10 and 11",
  "monthdays": ["10", "11"],
  "months": ["10"]
}

Add this period to your schedule, and the Instance Scheduler will keep the instances stopped on these days.

  1. The Instance Scheduler is designed to work with a single tag key for scheduling, which is defined during the initial configuration. It's not possible to use multiple different tag keys for scheduling within a single Instance Scheduler deployment. However, you can work around this limitation by using a combination of your existing "Schedule" tag and AWS Systems Manager.

Here's a potential solution:

  • Continue using the "Schedule" tag for your regular office hours scheduling.
  • Use your mandatory "Purpose" tag with the "Test" value as required.
  • Create an AWS Systems Manager Automation document that stops instances with the "Purpose" tag set to "Test" outside of office hours.
  • Set up an EventBridge rule to trigger this Automation document at the end of each workday.

This approach allows you to maintain your existing Instance Scheduler configuration while also addressing your requirement to stop "Test" instances after office hours without deploying another Instance Scheduler.
Sources
Automate stop and start schedules - AWS Prescriptive Guidance
Period reference - Instance Scheduler on AWS
Schedule reference - Instance Scheduler on AWS
Operator guide - Instance Scheduler on AWS

profile picture
answered a month ago
profile pictureAWS
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions