AWS Builder Center
Weekend Agent Challenge: Daily Weather & Quote Agent

Weekend Agent Challenge: Daily Weather & Quote Agent

AWS Serverless Agent that sends daily morning weather & motivational quote emails using Lambda, EventBridge, and SES

🌟 Vision & What the Agent Does

Every morning, the first thing most people check is the weather — "Should I carry an umbrella?", "Is it going to be hot today?", "What should I wear?" — and then they scroll through social media looking for some motivation to start the day. What if an intelligent agent could handle both of these tasks automatically?
The Daily Weather & Quote Agent is an AWS-powered serverless agent that solves this exact problem. It eliminates the need to manually check weather apps or motivational pages every morning by delivering a personalized email right to your inbox at 7:00 AM IST, every single day — without any human intervention.

What Problem Does It Solve?

  • āŒ No more opening multiple apps in the morning
  • āŒ No more forgetting to check weather before leaving home
  • āŒ No more searching for daily motivation
  • āœ… One automated email with everything you need to start your day

How It Works (Autonomous Behavior):

  1. Trigger: Amazon EventBridge fires a scheduled cron event every day at exactly 7:00 AM IST (1:30 AM UTC)
  1. Execution: AWS Lambda function activates automatically — no manual trigger needed
  1. Weather Fetch: The agent calls the wttr.in API to get real-time weather data (temperature, conditions) for Chennai
  1. Quote Selection: A motivational quote is randomly selected from a curated collection of 10 powerful quotes
  1. Email Composition: The agent composes a clean, friendly morning email with weather + motivation
  1. Delivery: Amazon SES delivers the email to the configured recipient
  1. Reporting: CloudWatch Logs capture every execution for monitoring and debugging
The agent runs completely autonomously — once deployed, it requires zero human interaction. It reports success/failure through CloudWatch logs and the email delivery itself serves as confirmation.



šŸ› ļø How I Built It

Development Process

I built this entire project using only the command line (CMD/PowerShell) on Windows — no AWS Console UI clicks. This was a deliberate choice to learn infrastructure-as-code principles and become comfortable with AWS CLI.

Key Decisions:

Decision
Why
wttr.in over OpenWeatherMap
No API key needed, faster setup, equally reliable
Random quotes over Bedrock AI
Bedrock model (Claude Haiku) was marked Legacy; random quotes ensure 100% reliability
Python 3.12 runtime
Latest stable runtime with best performance
SES over SNS
Email allows richer formatting than SMS
us-east-1 region
Best service availability and lowest latency for SES

Challenges & Solutions:

Challenge 1: Files not created in CMD When I started, I typed Ā index.pyĀ  in CMD expecting it to create a file — but CMD doesn't work that way! I learned to use Ā echoĀ  commands and Ā notepadĀ  to create files from the terminal.
Challenge 2: OpenWeatherMap 401 Unauthorized My initial approach used OpenWeatherMap API, but new API keys take up to 2 hours to activate. Solution: Switched to wttr.in — a free weather service that requires no API key at all.
Challenge 3: Bedrock Model Access Denied The Ā anthropic.claude-3-haikuĀ  model was marked as "Legacy" by the provider. Instead of waiting for model access approval, I pivoted to a random quote selection system — simpler, faster, and equally effective for the use case.
Challenge 4: SES Email Verification SES in sandbox mode requires both sender AND receiver emails to be verified. I had to verify both email addresses before emails could be sent successfully.
Challenge 5: Lambda deployment timing After updating Lambda code, I kept getting errors because the function was still in "InProgress" state. Solution: Added Ā timeout /t 10Ā  between deploy and invoke commands.



šŸ—ļø AWS Services Used / Architecture Overview

Services:

AWS Service
Role in Architecture
AWS Lambda
Core compute — runs the Python 3.12 function
Amazon EventBridge
Scheduler — triggers Lambda via cron expression
Amazon SES
Email service — sends the morning email
AWS IAM
Security — least-privilege role for Lambda
Amazon CloudWatch
Monitoring — logs every execution

Architecture Diagram:

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ │
│ ā° Amazon EventBridge │
│ │ Schedule: cron(30 1 * * ? *) [7:00 AM IST Daily] │
│ │ │
│ ā–¼ │
│ ⚔ AWS Lambda (Python 3.12) │
│ │ Function: DailyWeatherAgent │
│ │ Memory: 128MB | Timeout: 30s │
│ │ │
│ ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │
│ ā–¼ ā–¼ │
│ šŸŒ¦ļø wttr.in API šŸ’¬ Quote Engine │
│ │ GET /Chennai │ 10 Motivational Quotes │
│ │ → temp_C │ → random.choice() │
│ │ → weatherDesc │ │
│ │ │ │
│ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │
│ ā–¼ │
│ šŸ“§ Amazon SES │
│ │ From: abishek.s.ece.2023@snsce.ac.in │
│ │ To: dharaneesh85260@gmail.com │
│ │ │
│ ā–¼ │
│ šŸ“¬ Recipient Inbox │
│ "Good Morning, Abishek! Weather: 29C, Sunny..." │
│ │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

How the Agent is Triggered:

The agent uses event-driven architecture. Amazon EventBridge evaluates a cron expression (Ā cron(30 1 * * ? *)Ā ) every minute. At exactly 1:30 AM UTC (7:00 AM IST), it generates an event that invokes the Lambda function. The Lambda function has a resource-based policy allowing EventBridge to invoke it. No polling, no servers running 24/7 — pure event-driven serverless execution.



šŸ“š What I Learned

Technical Skills:

  • AWS CLI Mastery: Deployed an entire serverless application without touching the AWS Console UI — everything through command-line commands
  • IAM Security: Created custom trust policies and permission policies with least-privilege access (only SES and CloudWatch permissions)
  • Serverless Architecture: Understood how EventBridge + Lambda creates a powerful event-driven system with zero idle costs
  • SES Email Service: Learned about sandbox mode, email verification requirements, and sending limits
  • Debugging Lambda: Used CloudWatch logs and manual invoke to debug issues iteratively

Problem-Solving Approaches:

  • Pivot quickly: When OpenWeatherMap API took too long to activate, I immediately switched to wttr.in
  • Simplify when needed: When Bedrock had access issues, I used random quotes — simpler is often better
  • Test iteratively: After each code change, I zipped, deployed, and tested immediately

Key Takeaways:

  1. šŸŽÆ Start simple, iterate fast — Get a working version first, then enhance
  1. šŸ”§ CLI-first approach builds deeper understanding than UI clicks
  1. šŸ’” Free APIs exist for almost everything — wttr.in proved you don't always need paid services
  1. šŸ—ļø Serverless is powerful — this agent runs 24/7 for ₹0/month
  1. šŸ”’ Security matters — always use least-privilege IAM roles



šŸ”— Link to App & Repo




šŸ† Project Stats

Metric
Value
Total Development Time
~2 hours
Lines of Code
~50 (Python)
AWS Services Used
5
Monthly Cost
₹0 (Free Tier)
Emails Sent Daily
1
Uptime Required
0% (serverless!)


Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article