📖 Scenario: You are managing an AWS account and want to check the health and best practices of your AWS resources. AWS Trusted Advisor helps by giving recommendations to optimize your AWS environment.In this project, you will create a simple script to retrieve AWS Trusted Advisor recommendations using AWS SDK.
🎯 Goal: Build a script that connects to AWS Trusted Advisor service, retrieves the list of checks, and filters the recommendations for a specific category.
📋 What You'll Learn
Create a client to connect to AWS Support service
Retrieve the list of Trusted Advisor checks
Filter checks by category 'cost_optimizing'
Print the check names and their IDs
💡 Why This Matters
🌍 Real World
AWS Trusted Advisor helps cloud administrators optimize costs, improve security, and enhance performance by providing actionable recommendations.
💼 Career
Knowing how to programmatically access Trusted Advisor data is useful for cloud engineers and architects to automate monitoring and reporting.
Progress0 / 4 steps
1
Create AWS Support client
Create a variable called support_client that uses boto3.client to connect to the AWS Support service with the region set to 'us-east-1'.
AWS
Hint
Use boto3.client('support', region_name='us-east-1') to create the client.
2
Retrieve Trusted Advisor checks
Use the support_client to call describe_trusted_advisor_checks with language='en' and store the result in a variable called checks_response.
AWS
Hint
Call describe_trusted_advisor_checks(language='en') on support_client.
3
Filter checks by category
Create a list called cost_checks that contains only the checks from checks_response['checks'] where the 'category' is exactly 'cost_optimizing'.
AWS
Hint
Use a list comprehension to filter checks where check['category'] == 'cost_optimizing'.
4
Print check names and IDs
Use a for loop with variables check to iterate over cost_checks. Inside the loop, print the check['name'] and check['id'] separated by a dash.
AWS
Hint
Use a for loop and print the name and id of each check.
Practice
(1/5)
1. What is the primary purpose of AWS Trusted Advisor?
easy
A. To monitor real-time application logs
B. To deploy new AWS services automatically
C. To provide recommendations for cost savings, security, and performance improvements
D. To create backups of AWS resources
Solution
Step 1: Understand Trusted Advisor's role
AWS Trusted Advisor analyzes your AWS environment and suggests improvements in cost, security, fault tolerance, and performance.
Step 2: Compare options with Trusted Advisor's functions
Only To provide recommendations for cost savings, security, and performance improvements matches Trusted Advisor's purpose; others describe different AWS services.
Final Answer:
To provide recommendations for cost savings, security, and performance improvements -> Option C
Quick Check:
Trusted Advisor = Recommendations [OK]
Hint: Trusted Advisor gives advice, not deploys or monitors [OK]
Common Mistakes:
Confusing Trusted Advisor with AWS CloudWatch
Thinking it deploys services automatically
Assuming it manages backups
2. Which AWS Trusted Advisor category checks for unused or idle resources to help reduce costs?
easy
A. Cost Optimization
B. Fault Tolerance
C. Security
D. Performance
Solution
Step 1: Identify the category related to cost savings
The Cost Optimization category focuses on reducing unnecessary expenses by identifying idle or underused resources.
Hint: Cost Optimization finds idle resources to save money [OK]
Common Mistakes:
Choosing Security for cost-related checks
Confusing Fault Tolerance with cost savings
Selecting Performance instead of Cost Optimization
3. You run AWS Trusted Advisor and see a recommendation to "Enable Multi-Factor Authentication (MFA) on root account." What will happen if you follow this advice?
medium
A. Your root account will have an extra security layer requiring a second verification step
B. Your AWS resources will automatically back up daily
C. Your billing alerts will be disabled
D. Your EC2 instances will be stopped automatically
Solution
Step 1: Understand MFA's function on root account
Enabling MFA adds a second step to login, improving security by requiring a code from a device.
Step 2: Evaluate the effects of enabling MFA
It does not affect backups, billing alerts, or EC2 instance states; it only secures the root user login.
Final Answer:
Your root account will have an extra security layer requiring a second verification step -> Option A
Quick Check:
MFA = Extra login security [OK]
Hint: MFA means extra login step for security [OK]
Common Mistakes:
Thinking MFA triggers backups
Assuming it disables billing alerts
Believing it controls EC2 instance state
4. You receive a Trusted Advisor alert about "Security Groups with unrestricted access." What is the best way to fix this issue?
medium
A. Disable Trusted Advisor alerts
B. Remove rules that allow inbound traffic from 0.0.0.0/0 unless necessary
C. Open all ports to all IP addresses
D. Delete all security groups immediately
Solution
Step 1: Understand the risk of unrestricted access
Allowing inbound traffic from 0.0.0.0/0 means anyone on the internet can access your resources, which is risky.
Step 2: Apply the best security practice
Remove or restrict such rules to only trusted IPs or ranges; deleting all security groups or opening all ports is unsafe, and disabling alerts ignores the problem.
Final Answer:
Remove rules that allow inbound traffic from 0.0.0.0/0 unless necessary -> Option B
Quick Check:
Restrict open access = Fix security groups [OK]
Hint: Close open access, keep only needed IPs [OK]
Common Mistakes:
Deleting all security groups blindly
Opening all ports to everyone
Ignoring alerts by disabling them
5. Your company wants to improve fault tolerance using AWS Trusted Advisor. Which recommendation should you prioritize to achieve this?
hard
A. Use AWS Trusted Advisor to identify underutilized EC2 instances
B. Disable CloudTrail logging to reduce costs
C. Open all security group ports to increase accessibility
D. Enable Amazon S3 versioning to protect data from accidental deletion
Solution
Step 1: Understand fault tolerance goals
Fault tolerance means systems keep working despite failures, often by protecting data and resources.
Step 2: Evaluate recommendations for fault tolerance
Enabling S3 versioning protects data by keeping copies, improving fault tolerance. Identifying underutilized instances helps cost but not fault tolerance. Opening all ports reduces security. Disabling CloudTrail removes audit logs, harming security and fault tolerance.
Final Answer:
Enable Amazon S3 versioning to protect data from accidental deletion -> Option D
Quick Check:
Fault tolerance = Data protection with versioning [OK]