0
0
AWScloud~30 mins

Free tier usage monitoring in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Free tier usage monitoring
📖 Scenario: You have just started using AWS free tier services. To avoid unexpected charges, you want to monitor your usage of key AWS resources like EC2, S3, and Lambda.This project will help you create a simple script to track your free tier usage limits and current usage.
🎯 Goal: Build a script that stores AWS free tier usage limits, current usage data, calculates remaining free tier usage, and prints a summary report.
📋 What You'll Learn
Create a dictionary with AWS service names as keys and their free tier limits as values
Create a dictionary with current usage values for the same AWS services
Calculate the remaining free tier usage for each service
Print a clear summary showing service name, usage, limit, and remaining free tier
💡 Why This Matters
🌍 Real World
Monitoring free tier usage helps new AWS users avoid surprise bills by tracking how much of the free resources they have consumed.
💼 Career
DevOps engineers often build monitoring tools and alerts to manage cloud costs and resource usage efficiently.
Progress0 / 4 steps
1
Set up free tier limits data
Create a dictionary called free_tier_limits with these exact entries: 'EC2': 750, 'S3': 5000, 'Lambda': 1000000. These numbers represent the free tier limits for each service (hours for EC2, GB for S3, requests for Lambda).
AWS
Need a hint?

Use curly braces {} to create a dictionary with keys and values separated by colons.

2
Set up current usage data
Create a dictionary called current_usage with these exact entries: 'EC2': 300, 'S3': 1200, 'Lambda': 250000. These numbers represent your current usage for each service.
AWS
Need a hint?

Use the same dictionary syntax as before but with your current usage numbers.

3
Calculate remaining free tier usage
Create a new dictionary called remaining_usage using a dictionary comprehension. For each service in free_tier_limits, subtract the current_usage value from the free tier limit to get the remaining usage.
AWS
Need a hint?

Use a dictionary comprehension with {key: value for key in iterable} syntax.

4
Print usage summary report
Use a for loop with variables service to iterate over free_tier_limits. Inside the loop, print a line showing the service name, current usage, free tier limit, and remaining usage in this exact format: Service: EC2, Usage: 300, Limit: 750, Remaining: 450.
AWS
Need a hint?

Use an f-string inside the print statement to format the output exactly as shown.