📖 Scenario: You are managing an AWS environment where data transfer costs can add up quickly. To control expenses, you want to track how much data is transferred between different AWS services and regions.
🎯 Goal: Build a simple AWS configuration that defines data transfer usage metrics and sets thresholds to alert when costs might increase due to high data transfer.
📋 What You'll Learn
Create a dictionary with AWS services and their data transfer amounts in GB
Add a threshold value for maximum allowed data transfer in GB
Calculate which services exceed the threshold
Output a final configuration that lists services exceeding the threshold
💡 Why This Matters
🌍 Real World
Cloud engineers often need to monitor data transfer to avoid unexpected charges and optimize costs.
💼 Career
Understanding how to track and alert on data transfer usage is important for cost management roles in cloud operations.
Progress0 / 4 steps
1
Create data transfer dictionary
Create a dictionary called data_transfer_gb with these exact entries: 'EC2': 120, 'S3': 80, 'RDS': 50, 'Lambda': 30, 'CloudFront': 200
AWS
Hint
Use a Python dictionary with service names as keys and data transfer amounts as values.
2
Set data transfer threshold
Create a variable called threshold_gb and set it to 100 to represent the maximum allowed data transfer in GB.
AWS
Hint
Just assign the number 100 to the variable threshold_gb.
3
Identify services exceeding threshold
Create a list called high_transfer_services that contains the names of services from data_transfer_gb whose data transfer amount is greater than threshold_gb. Use a list comprehension with service and amount as variables.
AWS
Hint
Use a list comprehension to filter services where amount > threshold_gb.
4
Finalize configuration output
Create a dictionary called alert_config with a key 'services_exceeding_threshold' and assign it the value of high_transfer_services.
AWS
Hint
Create a dictionary with the specified key and assign the list of services exceeding the threshold.
Practice
(1/5)
1. Which type of AWS data transfer is usually free of charge?
easy
A. Data transfer between instances in the same Availability Zone using private IPs
B. Data transfer from AWS to the internet
C. Data transfer between different AWS regions
D. Data transfer from the internet to AWS
Solution
Step 1: Understand AWS data transfer zones
Data transfer within the same Availability Zone using private IPs is typically free because it stays inside the same physical location.
Step 2: Compare with other transfer types
Transfers to the internet or between regions usually incur costs due to crossing physical or network boundaries.
Final Answer:
Data transfer between instances in the same Availability Zone using private IPs -> Option A
Quick Check:
Same AZ private IP transfer = free [OK]
Hint: Same AZ private IP transfers are free, others usually cost [OK]
Common Mistakes:
Thinking all data transfers inside AWS are free
Confusing region transfer with same zone transfer
Assuming internet transfers are free
2. Which AWS data transfer direction is correctly paired with its typical cost behavior?
easy
A. Data transfer between different AWS regions - free
B. Data transfer from AWS to the internet - charged
C. Data transfer within the same Availability Zone using public IP - free
D. Data transfer from the internet to AWS - charged
Solution
Step 1: Review common AWS data transfer costs
Data transfer from AWS to the internet is usually charged because it leaves AWS's network.
Step 2: Check other options for correctness
Transfers between regions are charged, same AZ public IP transfers are charged, and internet to AWS transfers are usually free.
Final Answer:
Data transfer from AWS to the internet - charged -> Option B
Quick Check:
AWS to internet = charged [OK]
Hint: AWS to internet data transfer usually costs money [OK]
Common Mistakes:
Assuming cross-region transfer is free
Confusing public and private IP transfer costs
Thinking inbound internet data is charged
3. Consider this AWS setup: An EC2 instance in us-east-1 sends 10 GB of data to an EC2 instance in us-west-2. Which cost applies?
medium
A. Only storage cost applies, no data transfer cost
B. No charge because both are EC2 instances
C. Free data transfer within the same AWS account
D. Data transfer charge for cross-region transfer applies
Solution
Step 1: Identify the data transfer type
Data moves between two different AWS regions (us-east-1 to us-west-2), which is cross-region transfer.
Step 2: Understand cost implications
Cross-region data transfer is charged by AWS because data crosses physical boundaries and networks.
Final Answer:
Data transfer charge for cross-region transfer applies -> Option D
Quick Check:
Cross-region transfer = charged [OK]
Hint: Cross-region data transfer always costs money [OK]
Common Mistakes:
Assuming all EC2 to EC2 transfers are free
Ignoring region boundaries
Confusing storage and transfer costs
4. You notice unexpectedly high AWS bills. You find data transfer between two EC2 instances in the same region but different Availability Zones. What is the likely cause?
medium
A. Data transfer inside the same instance is charged
B. Data transfer within the same AZ is charged
C. Data transfer between AZs in the same region is charged
D. Data transfer to the internet is free
Solution
Step 1: Identify the data transfer path
Data moves between two Availability Zones in the same region, which is cross-AZ transfer.
Step 2: Check AWS cost rules for cross-AZ transfer
AWS charges for data transfer between AZs even within the same region, causing higher bills.
Final Answer:
Data transfer between AZs in the same region is charged -> Option C
Quick Check:
Cross-AZ transfer = charged [OK]
Hint: Cross-AZ data transfer costs money, same AZ private IP does not [OK]
Common Mistakes:
Assuming same region means free transfer
Confusing AZ and instance boundaries
Thinking internet transfer is free
5. You design an application with EC2 instances in two regions: us-east-1 and eu-central-1. The app frequently transfers 50 GB daily between these regions. How can you reduce data transfer costs?
hard
A. Use S3 buckets in each region and replicate data asynchronously
B. Move all instances to the same Availability Zone
C. Transfer data via the public internet to avoid AWS charges
D. Use AWS Direct Connect to create a dedicated network link between regions
Solution
Step 1: Understand cross-region transfer costs
Frequent large data transfers between regions incur high costs.
Step 2: Evaluate cost-saving strategies
Using S3 replication asynchronously reduces direct cross-region transfer costs by syncing data efficiently.
Step 3: Analyze other options
AWS Direct Connect is for on-premises to AWS, not cross-region; moving instances to same AZ is impossible across regions; public internet transfer still incurs costs and latency.
Final Answer:
Use S3 buckets in each region and replicate data asynchronously -> Option A
Quick Check:
Async S3 replication reduces cross-region transfer costs [OK]
Hint: Use S3 replication to cut cross-region transfer costs [OK]
Common Mistakes:
Thinking Direct Connect works cross-region
Assuming public internet transfer is cheaper
Trying to put instances in same AZ across regions
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.