AWS Builder Center
Weekend Agent Challenge: Weather Pulse NZ

Weekend Agent Challenge: Weather Pulse NZ

A scheduled AWS agent that fetches NZ weather and air quality each morning, compares against yesterday, and delivers a Bedrock digest to email, Slack, and a private HTML report.

Platform Engineer | AWSUG Wellington Lead | AWS Community Day Aotearoa and Oceania Event Organizer

Vision & What the Agent Does

Weather Pulse NZ is an always-on morning agent for New Zealand. Every day at 06:30  Pacific/Auckland , it wakes up on its own — no button click, no human in the loop — pulls forecast and air quality for eight cities, compares the day against the previous run, and ships a short briefing to the places people already look: email, Slack, and a full HTML report.
Problem it solves. Weather and air-quality noise is scattered across apps and alerts. I wanted one NZ-local digest that answers three questions before work starts: What is the mood of the day? What changed since yesterday? Where are the watchouts (wind, AQI)?
What triggers it. Amazon EventBridge Scheduler fires the agent once per day in  ap-southeast-2 , with retries if the invoke fails. The schedule uses NZ local time so NZST/NZDT transitions stay correct.
Autonomous actions each run.
  1. Fetch Open-Meteo forecast + US AQI for Auckland, Hamilton, Tauranga, Wellington, Nelson, Christchurch, Queenstown, and Dunedin.
  1. Compute nationwide extremes, North vs South Island contrast, and threshold flags (for example wind gusts ≥ 40 km/h).
  1. Load the last-run snapshot from DynamoDB and compute deltas (new/cleared alerts, notable swings).
  1. Build an executive brief (headline, bullets, mood: quiet / notable / severe). Mood comes from thresholds and deltas; Amazon Bedrock Claude 3 Haiku narrates the digest, with a deterministic template fallback if Bedrock is unavailable.
  1. Write private S3 objects ( reports/latest.html  plus dated  raw/  JSON), publish SNS email, and post a mood-colored Slack message.
  1. Expose a short Lambda Function URL ( …/report ) that GETs the HTML from private S3 — no long pre-signed URL in the address bar. Non-GET requests return 405 so the public URL cannot trigger the pipeline.
How it reports back. Readers get the digest in SNS email and Slack (with “View full report”), and can open the Function URL for the city board, extremes, AQI watch, and delta section.
Figure 1. SNS email digest — mood, key points, watchouts, and short report link.

Figure 2. Slack Incoming Webhook — mood-colored attachment and “View full report”.

Figure 3. HTML report — hero + executive brief.

Figure 4. HTML report — city snapshot board for all eight NZ cities.

Figure 5. HTML report — NZ extremes, air quality watch, and delta vs last run.



How You Built It

I started from product specs in Kiro ( .kiro/specs/weather-pulse-nz/  — requirements, design, tasks) so the agent stayed a scheduled pipeline, not a chat UI. Infrastructure is Terraform in  ap-southeast-2 : Lambda, EventBridge Scheduler, DynamoDB, S3, SNS, SSM Parameter Store, IAM, and a Function URL.
Key decisions
  • Schedule over chat. The Weekend Agent Challenge asks for autonomy. EventBridge Scheduler is the contract: same local time every morning.
  • Mood from facts, prose from Bedrock. Thresholds and deltas always own the mood; Claude 3 Haiku only narrates. If Bedrock fails, a template path still ships a usable briefing.
  • Private report, short link. Keeping the S3 bucket private and proxying HTML through  GET /report  avoids leaking long-lived pre-signed URLs in Slack/email while still giving a clean browser URL.
  • SSM for the Slack webhook. The webhook is a SecureString; Terraform can create a placeholder, and the real value is set once without putting secrets in git.
Challenges and how they were overcome
  • First-run deltas. With no prior snapshot, “quiet” vs “bad AQI” could mislead. The agent treats first run / missing comparison explicitly and still surfaces absolute watchouts.
  • Function URL abuse. Early on, any method on the Function URL could hit the handler. A method gate returns 405 for non-GET so the public endpoint only serves report assets.
  • Bedrock access. Model access and IAM must exist in-region; the template fallback keeps the daily run useful when inference is denied or times out.
  • Demo for a general audience. Ops docs are detailed; the walkthrough focuses on architecture, email, Slack, and a three-part HTML report so viewers see the product, not Terraform commands.
Development loop: local  pytest , Terraform plan/apply, manual  aws lambda invoke , then verify CloudWatch logs, SNS, Slack, and  …/report .

AWS Services Used / Architecture Overview

Service
Role
Amazon EventBridge Scheduler
Daily trigger at 06:30  Pacific/Auckland 
AWS Lambda
Agent runtime (Python) + Function URL for report/assets
Amazon DynamoDB
Last-run snapshot for deltas
Amazon S3
Private HTML report + raw JSON archive
Amazon Bedrock
Claude 3 Haiku narrative digest
Amazon SNS
Email delivery of the digest
AWS Systems Manager Parameter Store
Slack webhook (SecureString) + report link URL
Amazon CloudWatch Logs
Execution logs ( /aws/lambda/weather-pulse-nz )
IAM
Least-privilege roles for invoke, S3, DynamoDB, Bedrock, SNS, SSM
External: Open-Meteo (forecast + AQI), Slack Incoming Webhook, reader browser.
Figure 6. Architecture — EventBridge Scheduler → Lambda in ap-southeast-2, with private S3 report via Function URL.

Architecture sketch (text)
EventBridge Scheduler (06:30 NZ)
│
▼
Open-Meteo - - ► AWS Lambda (forecast + AQI)
│
├── DynamoDB (last snapshot)
├── Bedrock Claude 3 Haiku
├── S3 private reports/ + raw/
├── SSM Parameter Store
├── SNS - - ► email
└── Slack Incoming Webhook
Browser - - GET /report - ► Lambda Function URL ──GetObject──► S3
Region: ap-southeast-2. Steady-state cost stays low — one scheduled run per day.

What You Learned

  • Autonomy is a product choice. A clear schedule, retries, and a fallback digest matter more than a clever prompt alone.
  • Separate “truth” from “voice.” Letting thresholds own mood and Bedrock own wording made failures graceful and demos trustworthy.
  • Public edges need design. A short Function URL is friendlier than a pre-signed URL, but it must be read-only and method-gated.
  • Specs speed weekend builds. Kiro requirements → design → tasks kept Terraform and Lambda aligned with the story I wanted to tell in this article.
  • Show the outputs. For a general audience, architecture + email + Slack + HTML report communicate the agent better than a pure IaC walkthrough.

Link to App or Repo

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