0
0
AWScloud~30 mins

Right-sizing resources in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Right-sizing AWS EC2 Instances
📖 Scenario: You are managing cloud resources for a small company. They have several AWS EC2 instances running, but some are too large and costly for their needs. Your task is to help them identify and right-size these instances to save money while keeping performance.
🎯 Goal: Build a simple AWS resource configuration that lists EC2 instances with their current sizes and then creates a recommended smaller instance type for right-sizing.
📋 What You'll Learn
Create a dictionary of EC2 instances with their current instance types
Add a configuration variable for the maximum allowed instance size
Write logic to recommend a smaller instance type if the current one is larger than allowed
Output the final dictionary with instance IDs and their recommended instance types
💡 Why This Matters
🌍 Real World
Cloud engineers often need to optimize resource usage to reduce costs and improve efficiency. Right-sizing instances is a common task to avoid paying for more capacity than needed.
💼 Career
Understanding how to analyze and recommend resource sizes is valuable for roles like Cloud Engineer, DevOps Engineer, and Infrastructure Architect.
Progress0 / 4 steps
1
Create EC2 instances dictionary
Create a dictionary called ec2_instances with these exact entries: 'i-12345': 't3.large', 'i-67890': 't3.xlarge', 'i-abcde': 't2.medium'
AWS
Need a hint?

Use a Python dictionary with instance IDs as keys and instance types as values.

2
Add maximum allowed instance size
Add a variable called max_instance_size and set it to the string 't3.large'
AWS
Need a hint?

This variable will help decide if an instance is too large.

3
Write right-sizing recommendation logic
Create a dictionary called recommended_sizes. Use a for loop with variables instance_id and instance_type to iterate over ec2_instances.items(). For each instance, if instance_type is larger than max_instance_size, set its recommended size to max_instance_size, otherwise keep the current instance_type.
AWS
Need a hint?

Use a dictionary and a for loop to compare instance types and assign recommended sizes.

4
Complete with final recommended sizes dictionary
Add a final line that creates a variable called final_recommendations and sets it equal to recommended_sizes
AWS
Need a hint?

This final variable holds the right-sizing recommendations.