AWS Builder Center
Weekend Annoying Task Challenge: Umbrella Bot

Weekend Annoying Task Challenge: Umbrella Bot

A fully serverless, event-driven notification system that utilizes AWS Lambda, EventBridge, and Amazon SNS to proactively evaluate daily weather forecasts and dispatch SMS alerts only when precipitation is detected.

Vision & What the app does In modern software engineering, we continually seek opportunities to automate routine tasks and eliminate operational friction. Yet, small daily inefficiencies often persist in our personal routines, such as manually launching a weather application every morning to decide whether to pack an umbrella for the daily commute, or forgetting entirely and getting caught in unexpected rain.
To address this friction, Umbrella Bot was designed as an event-driven, automated background notification system. Built to operate with zero manual intervention, the application automatically evaluates local meteorological forecasts every morning at 7:00 AM.
If the system detects precipitation (such as rain, drizzle, or thunderstorms) within a 12-hour forecast window, it immediately dispatches a concise SMS text message to the user’s mobile device: "🌧️ Umbrella Alert! There is rain in the forecast today. Stay dry!" Conversely, if the forecast is clear or sunny, the system intentionally remains completely silent. This "zero-noise" philosophy ensures that notifications are only sent when actionable intervention is required.
How You Built It The goal for this build was to achieve complete end-to-end cloud automation with zero infrastructure overhead and zero frontend clutter.
Development Process API Integration: Selected the OpenWeatherMap 5-Day / 3-Hour Forecast API as the primary data source, configuring latitudinal and longitudinal coordinates to accurately query local weather conditions.
Compute & Business Logic: Developed a lightweight Node.js script executed inside an AWS Lambda environment. The script issues an asynchronous HTTP fetch request to the weather API, iterates through the 3-hour forecast data chunks for the upcoming 12 hours, and evaluates weather condition codes (specifically targeting codes under 600, which indicate rain, drizzle, or thunderstorms).
Notification Engine Setup: Integrated Amazon Simple Notification Service (SNS) to publish SMS payloads. Formatted a dedicated SNS Standard Topic as the central messaging bus, subscribing the target destination mobile number to the channel.
Scheduled Execution: Configured an Amazon EventBridge Scheduler rule using a Cron expression (0 7 * * ? *) set explicitly to the target local time zone.
Key Decisions & Challenges Encountered Navigating the SNS SMS Sandbox: To prevent spam and misuse, AWS restricts new accounts to an SNS SMS Sandbox. During early testing, message delivery failed until the destination phone number was explicitly added and verified via One-Time Passcode (OTP) within the AWS Console. Furthermore, an IAM policy permitting sns: Publish actions had to be explicitly attached to the Lambda execution role.
Topic ARNs vs. Subscription ARNs: An early integration hurdle involved routing errors within the AWS SDK. Initially, the code attempted to dispatch messages using the individual Subscription ARN. Resolving this required targeting the overarching Topic ARN, allowing the SNS control plane to handle subscriber routing cleanly.
Precision Cloud Scheduling: Default cloud scheduling configurations can introduce variable execution delays to distribute server load. To ensure the notification arrives reliably prior to the morning commute, the "Flexible Time Window" setting in EventBridge was disabled, enforcing execution at 7:00 AM sharp.
AWS Services Used / Architecture Overview The solution utilizes a fully serverless, pay-as-you-go architecture on AWS:
Amazon EventBridge (Scheduler): Serves as the system's cron trigger, waking up the compute layer at precisely 7:00 AM local time every day.
AWS Lambda: Houses the core Node.js application logic. It handles the external API request, parses JSON payloads, evaluates conditional logic, and invokes the messaging engine.
Amazon Simple Notification Service (SNS): Acts as the messaging bus, securely delivering the SMS payload to the destination device upon invocation.
AWS IAM: Defines granular execution roles and security policies, ensuring the Lambda function operates strictly under the principle of least privilege.
Architecture Flow & Triggering Mechanism Plaintext [ EventBridge Scheduler ] │ (Triggers at 7:00 AM daily) ▼ [ AWS Lambda Function ] ────► [ OpenWeatherMap API ] (Queries 12-hr forecast) │ │ (If rain condition code < 600) ▼ [ Amazon SNS Topic ] │ ▼ [ User Mobile Device (SMS) ]
What You Learned Building this project provided valuable hands-on experience in designing event-driven backend systems without relying on full-stack web frameworks:
Decoupled System Design: Reinforced the principle that powerful cloud utilities do not always require a graphical user interface. Pure background automation often yields higher efficiency for specific productivity tasks.
Granular IAM Security: Gained deeper proficiency in managing AWS Identity and Access Management policies, specifically configuring cross-service permissions between EventBridge, Lambda, and SNS.
Cloud Scheduling & Timezone Alignment: Learned the nuances of managing EventBridge Cron syntax across international time zones and configuring execution window parameters for time-sensitive alerts.
Link to App or Repo Source Code Repository: https://github.com/farhanashrafdev/serverless-weather-alert-agent 
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