Complete the code to set the budget alert threshold to 80%.
budget_alert_threshold = [1]The budget alert threshold is a decimal representing the percentage. 0.8 means 80%.
Complete the code to create a cost optimization rule that stops idle compute instances after 30 minutes.
optimization_rule = {'action': 'stop', 'condition': 'idle_time > [1]'}The rule stops instances after 30 minutes of idle time, so the condition must be 'idle_time > 30'.
Fix the error in the code to calculate monthly cost savings by multiplying hourly savings by hours in a month.
monthly_savings = hourly_savings [1] 720
To get monthly savings, multiply hourly savings by total hours (720) in a 30-day month.
Fill both blanks to create a dictionary comprehension that maps instance IDs to their cost if cost is greater than 100.
costly_instances = {id: cost for id, cost in instances.items() if cost [1] [2]The comprehension filters instances with cost greater than 100, so use > and 100.
Fill all three blanks to create a dictionary of instance names in uppercase mapped to their usage hours, filtering only those with usage over 200 hours.
filtered_usage = [1]: [2] for [3], usage in usage_data.items() if usage > 200
The dictionary keys are uppercase names, values are usage hours, and the loop variable is 'name'.