Skip to content

Help with DynamoDB table for EC2 scheduler

0

Hello,

I have the following table items setup but it doesn't appear to be taking effect.

type name begintime description endtime Endtime Enforced months organization_id override_status Periods periods remote_account_ids Starttime Timezone timezone weekdays Weekdays Schedule Shift1 TRUE [{"S":"Shift1"}] EST Schedule Shift2 TRUE [] EST Schedule Shift3 TRUE [] EST config scheduler [""] schedule running Instances running running schedule scale-up-down "Vertical scaling on weekdays, based on UTC time" ["weekends@t2.nano","working-days@t2.micro"] UTC schedule seattle-office-hours Office hours in Seattle (Pacific) ["office-hours"] US/Pacific schedule stopped Instances stopped stopped schedule uk-office-hours Office hours in UK ["office-hours"] Europe/London period first-monday-in-quarter Every first monday of each quarter ["jan/3"] ["mon#1"] period office-hours 9:00 Office hours 17:00 ["mon-fri"] period shift1period 3:00 1:00 [{"S":"Monday"},{"S":"Tuesday"},{"S":"Wednesday"},{"S":"Thursday"},{"S":"Friday"}] period shift2period [] period shift3period [] period weekends Days in weekend ["sat-sun"] period working-days Working days ["mon-fri"]

asked a year ago182 views

1 Answer
0

I see several issues with your DynamoDB table configuration for the Instance Scheduler that would prevent it from working correctly:

  1. Inconsistent attribute naming: You have a mix of lowercase and capitalized attribute names (e.g., "weekdays" vs "Weekdays", "periods" vs "Periods"). The Instance Scheduler expects consistent attribute naming.

  2. Incorrect data types: Some of your values are in array format with type indicators like [{"S":"Monday"}] which suggests you're viewing the raw DynamoDB representation rather than the actual values.

  3. Missing connections: Your "Shift1" schedule references a period named "Shift1" in its "Periods" attribute, but there's no corresponding period with that name. Instead, you have "shift1period", "shift2period", and "shift3period".

  4. Incorrect time formats: For the shift periods, the time formats are inconsistent. For example, "shift1period" has endtime "3:00" and Starttime "1:00", which is confusing (end time before start time).

To fix these issues:

  1. Ensure consistent attribute naming - use lowercase for all attributes (e.g., "type", "name", "begintime", "endtime", "weekdays", "periods").

  2. Make sure your periods are properly defined with correct begin and end times. For example:

type: period
name: shift1period
begintime: 01:00
endtime: 03:00
weekdays: mon-fri
  1. Update your schedules to reference the correct period names:
type: schedule
name: Shift1
periods: [shift1period]
timezone: EST
  1. Remove duplicate attributes (e.g., having both "Timezone" and "timezone").

  2. Ensure time formats are consistent (use HH:MM format).

After making these corrections, your Instance Scheduler should start working as expected.
Sources
Automate stop and start schedules - AWS Prescriptive Guidance
Troubleshoot the Instance Scheduler on AWS for EC2 instances | AWS re:Post
Schedule reference - Instance Scheduler on AWS

answered a year 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.