Daily Sky Haiku: Building an Autonomous AI Poetry Agent with Amazon Bedrock
说明与用途
一个自动化的每日俳句生成器,使用天气数据生成诗歌并通过 Netlify 发布,无需人工操作。
问题
Create a fully autonomous daily haiku generator that pulls real‑world weather data and publishes a new poem each morning without user intervention.
结果
The system autonomously produces a weather‑inspired haiku each morning, stores it in S3, and serves it via a public website, eliminating manual prompts.
工作流
- Schedule EventBridge rule to trigger daily at 7:00 AM IST (cron(30 1 * * ? *)).
- AWS Lambda function retrieves current weather for Kochi from Open‑Meteo API.
- Lambda constructs a prompt incorporating weather data and sends it to Amazon Bedrock (Nova Lite) to generate a three‑line haiku.
- Lambda combines the poem with location, temperature, humidity, weather conditions, and timestamp into a JSON object.
- Lambda writes the JSON to Amazon S3 as latest.json.
- Netlify‑hosted frontend fetches latest.json from S3 and displays the haiku on the public website.
证据
Built using Amazon Bedrock, AWS Lambda, Amazon EventBridge, and Amazon S3, the application automatically retrieves weather information, generates a poem using Amazon Nova Lite, and publishes the latest result to a public website.
EventBridge Triggers the Workflow
I created an EventBridge scheduled rule named daily-sky-haiku-morning.
The schedule uses this cron expression: cron(30 1 * * ? *)
Lambda retrieves the current weather information for Kochi using the Open‑Meteo API.
Lambda prepares a creative prompt using the retrieved weather information and sends it to Amazon Bedrock.
I use Amazon Nova Lite to generate a weather-themed poem consisting of three lines.
The generated result is stored in Amazon S3 as a JSON object named: latest.json
The public frontend, deployed on Netlify, reads the stored JSON file and displays the latest haiku.
- 记录日期: 2026-10-27T10:11:30.511Z