Lab complete!
Now that you have completed this lab, make sure to update your Well-Architected review if you have implemented these changes in your workload.
Click here to access the Well-Architected Tool
With its default configuration, the Instance Scheduler solution will apply the “seattle-office-hours” schedule to all EC2 Instances that have a tag with Key=“Schedule” and Value=“seattle-office-hours”. This is the only configuration that needs to be done to stop the instance outside Seattle Office hours. A Cloud Center of Excellence (CCOE) team could configure this at scale using Tag Editor feature of AWS Resource Groups with batch of 500 instances, or with custom automation (i.e. with AWS SSM). End users and application owners could do the same for their resources. In the following steps we will use Resource Groups and Tag Editor to configure the tag Schedule=seattle-office-hours to all DEV instances in this account/region.
Open the Resource Groups and Tag Editor Console using this link:
Click on Tag Editor on the left side panel:
AWS::EC2::Instance
:For the Tags, we need to search based on two tags.
Add a tag named walab-environment
with value dev
. Click on the “Add” button.
Add another tag named aws:autoscaling:groupName
with value (not tagged)
. Click on the “Add” button.
By adding the above, we are excluding any EC2 instances that has a tag named aws:autoscaling:groupName
(those launched by EC2 Auto Scaling Groups). We need to exclude any instances that are part of an Auto Scaling Group (ASG) to avoid the Instance Scheduler solution entering into a loop where it will stop instances that an ASG would immediately replace with new ones.
Now that both tag definitions were added to the search criteria, click on the “Search resources” button:
Scroll down. You should now see the list of dev instances that are present in this account, select them all and click on “Manage Tags of selected resources”
Schedule
with value seattle-office-hours
. Then, click on “Review and apply tag changes”. (Note that tags are case sensitive, be aware of any trailing blank spaces)You have completed the last section of this lab!
In this lab you could see how to benefit from the Instance Scheduler on AWS solution to increase the elasticity of your AWS infrastructure and follow a time-based supply approach for cost optimization. As keeping instances in a stopped state when they are not needed will decrease your costs considerably.
With the default seattle-office-hours schedule used in this lab, we have reduced by 76% the costs of the DEV workloads. Using the scheduler-cli you could define your own schedules, and instruct the end-users to apply such schedules on their DEV environments. This would shift the responsibility around elasticity for EC2 workloads to the application owners and the end users. You can then measure savings using AWS Cost Explorer or the Cost and Usage Report (CUR). Cost Explorer and CUR billing data are delayed by ~48hours, so after ~2days you should be able to visualize the savings.
To get a better idea with another example on how a time-based supply approach can help in optimizing cost, in below image, you can see how the Cost Explorer report would look like when stopping instances at a large scale, but only during weekends.
For this example, a larger fleet of EC2 instances was used, accounting to ~22K USD/day across all instances. Notice that after using Instance Scheduler for stopping a subset of those instances, the cost was reduced to ~15K USD/day during weekends, which equates to a total of ~55K USD/month savings.
Click on Next Step and follow the steps to clean up the resources created in this lab.
Now that you have completed this lab, make sure to update your Well-Architected review if you have implemented these changes in your workload.
Click here to access the Well-Architected Tool