hands-on lab

Utilizing Lightswitch and Janitor Patterns for Cost Optimization of AWS Cloud Resources

Difficulty: Intermediate
Duration: Up to 1 hour
Students: 34
Rating: 5/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

In this hands-on lab, you'll dive into the practical application of Lightswitch and Janitor patterns, essential methodologies for cost-saving and efficient resource management within Amazon Web Services (AWS). You’ll learn how to use the Lightswitch pattern to intelligently turn off running compute instances during non-utilization periods to minimize costs. Additionally, you’ll explore the Janitor pattern, focusing on the identification and deletion of unused and untagged resources to declutter the AWS cloud environment and reduce unnecessary expenses.

You’ll learn how to deploy and configure a set of Python-based Lambda Functions which perform various cost optimization strategies within the lab-provided AWS account. The first Lambda Function will implement the Lightswitch pattern to scan running EC2 instances within the lab-provided AWS account and perform various actions based on the tagging configuration applied to each EC2 instance. The second Lambda Function will implement the Janitor pattern to detect unused/unreferenced AWS resources (EBS volumes, EIPs, etc.).

Learning objectives

At the conclusion of this hands-on lab, you’ll have learnt the following actionable strategies to effectively optimize your own AWS cloud resources:

  • Applying cost management and operational efficiency strategies to various AWS resources
  • Applying the light pattern with tagging to cost-optimise compute resources
  • Applying the janitor pattern to identify unused cloud resources
  • Leverage event-driven architectures to run ad-hoc cost optimization processes

Intended audience

  • Cloud Architects
  • DevOps Engineers
  • Software Engineers

Prerequisites

Familiarity with the following will be beneficial but is not required:

  • FinOps
  • Cost Optimization
  • Event-Driven Architecture
  • AWS Lambda

The following content can be used to fulfill the prerequisites:

Environment before

Environment after

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
IDE Access
Implement the Lightswitch Pattern
Implement the Janitor Pattern