0
0
AWScloud~15 mins

Instance types and families in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Instance types and families
📖 Scenario: You are setting up a cloud environment and need to organize information about different AWS EC2 instance types and their families. This will help you choose the right instance for your applications.
🎯 Goal: Create a dictionary that holds AWS EC2 instance types grouped by their families. Then, add a configuration variable to select a family, filter the instance types by that family, and finally output the filtered list.
📋 What You'll Learn
Create a dictionary called instance_families with exact keys and values
Add a variable called selected_family with a specific family name
Use a list comprehension called filtered_instances to select instances from the chosen family
Add a final line that assigns result to filtered_instances
💡 Why This Matters
🌍 Real World
Organizing instance types by family helps cloud architects quickly select the right compute resources for different workloads.
💼 Career
Understanding instance types and families is essential for roles like cloud engineer, solutions architect, and DevOps specialist.
Progress0 / 4 steps
1
Create the instance families dictionary
Create a dictionary called instance_families with these exact entries: 'general_purpose': ['t2.micro', 't3.medium', 't3.large'], 'compute_optimized': ['c4.large', 'c5.xlarge', 'c5.2xlarge'], and 'memory_optimized': ['r4.large', 'r5.xlarge', 'r5.2xlarge'].
AWS
Need a hint?

Use curly braces to create a dictionary. Each key is a string and each value is a list of strings.

2
Add a selected family variable
Add a variable called selected_family and set it to the string 'compute_optimized'.
AWS
Need a hint?

Assign the string 'compute_optimized' to the variable selected_family.

3
Filter instances by selected family
Create a list called filtered_instances using a list comprehension that selects all instance types from instance_families[selected_family].
AWS
Need a hint?

Use a list comprehension to copy all instances from the selected family list.

4
Assign the final result
Add a line that assigns the variable result to the value of filtered_instances.
AWS
Need a hint?

Simply assign the list filtered_instances to the variable result.