- Lab
- A Cloud Guru
Use AWS Instance Scheduler to Shut Down an EC2 instance
In this hands-on lab, we will deploy the AWS Instance Scheduler solution to shut down an EC2 instance based on a custom schedule we will create. Instance Scheduler can help you save money and provide cost optimization for workloads.
Path Info
Table of Contents
-
Challenge
Deploy AWS Instance Scheduler
- Navigate to the AWS Instance Scheduler.
- Click Launch solution in the AWS Console.
- In the CloudFormation console, enter a name for our CloudFormation stack.
- Add tags:
started-by=InstanceScheduler
stopped-by=InstanceScheduler
-
Challenge
Edit the DynamoDB Tables
- Navigate to DynamoDB > Tables.
- elect the ConfigTable.
- Select the
uk-office-hours
item. - Click Actions > Duplicate.
- Change the description to "Office hours in US".
- Change the string to "us-office-hours".
- Change the time zone to "US/Eastern".
- Click Save and then refresh the table.
-
Challenge
Add Tag to EC2 Instance
- Navigate to EC2 > Instances.
- Select the running instance.
- Add the following tag:
- Key: Schedule
- Value: us-office-hours
- Click Save.
-
Challenge
Update Amazon EventBridge Events Rule
- Navigate to Amazon EventBridge > Events > Rules.
- Select the listed rule.
- Click Actions > Edit.
- Click Edit, then Next.
- Change the* 0/5 minutes* to 0/1 minute.
- Click Next, Next, Next.
- Click Update rule.
-
Challenge
Update DynamoDB Config Table
- Navigate to DynamoDB > Tables.
- Click the ConfigTable.
- Update the
endtime
so the business day ends five minutes from your current time (e.g., if it's 8 AM where you are right now, change theendtime
to08:05
.) - Click Save.
-
Challenge
Verify EC2 Instance Stopped
- Navigate to EC2 > Instances.
- Verify our EC2 instance has stopped.
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.