Using Instance Scheduler to Automate Starting and Stopping EC2 and RDS Resources

30 minutes
  • 5 Learning Objectives

About this Hands-on Lab

In this lab, you will take what you have learned about Instance Scheduler and deploy the solution to the lab AWS account. You will use SSM Session Manager to access the provided `SchedulerAdmin` EC2 instance that has the scheduler CLI already installed and configure the appropriate IAM permissions for the instance. You will also configure periods and schedules for different dinosaurs (AWS resources) based on the proposed sleep schedule and associate each dinosaur with their own schedule.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Deploy Instance Scheduler

Using the AWS Instance Scheduler documentation, deploy Instance Scheduler to the lab AWS account. Make sure to set scheduling for both EC2 and RDS resources.

Log In to the SchedulerAdmin Instance

Using SSM Session Manager, connect and get logged into the SchedulerAdmin instance provided with the lab.

Use the Scheduler CLI to Configure Periods for the Dinosaur Sleep Schedules

Update the IAM role for the SchedulerAdmin instance to include the SchedulerAdminPolicy permission for scheduler CLI commands. Then use the scheduler CLI to configure periods based on the following sleep schedule table:

NameBreedWake-Up TimeBed Time
StacyStegosaurus7 a.m. UTC9 p.m. UTC
TerranceT-Rex9 a.m. UTC10 p.m. UTC
RalphRaptor6 a.m. UTC9:30 p.m. UTC
Roxy*Raptor6 a.m. & 1:30 p.m. UTC1:15 p.m. & 9:30 p.m. UTC
TamiTriceratops11 a.m. UTC8:30 p.m. UTC

NOTE: Roxy needs to get a checkup by her doctors every day due to a recent surgery

Use the Scheduler CLI to Configure Schedules for Each Dinosaur

Create a unique schedule for each dinosaur and associate the periods created to the appropriate schedules. All schedules should have the timezone set to UTC and the enforced parameter enabled.

Tag Each Dinosaur with Their Schedule

Using the table below to map the dinosaurs to their respective AWS resources, tag each AWS resource with the dinosaur’s schedule:

Dinosaur NameAWS Resource
StacyEC2 – t3.micro
TerranceRDS – t3.micro
RalphEC2 – t3.micro
RoxyEC2 – t3.micro
TamiEC2 – t3.micro

Additional Resources

Lab Information

In this lab activity, you will be an engineer at a theme park called DinoAdventures. The dinosaurs have been running rampant, and as an engineer, you are responsible for setting up the sleep schedules for various dinosaurs using Instance Scheduler so they don’t break out and cause destruction at night (especially those darn raptors). Below is the proposed sleep schedule for each of the dinosaurs:

Resources

Deployment Guide

AWS Instance Scheduler documentation

Dinosaur Sleep Schedules

NameBreedWake-Up TimeBed Time
StacyStegosaurus7 a.m. UTC9 p.m. UTC
TerranceT-Rex9 a.m. UTC10 p.m. UTC
RalphRaptor6 a.m. UTC9:30 p.m. UTC
Roxy*Raptor6 a.m. & 1:30 p.m. UTC1:15 p.m. & 9:30 p.m. UTC
TamiTriceratops11 a.m. UTC8:30 p.m. UTC

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?