AWS Builder Center

Weekend Creative Agent Challenge: ABC Diário

A serverless agent that turns daily weather in ABC Paulista, Brazil into a poem — running automatically every morning via AWS Lambda, EventBridge, and S3.

Estudante de CC | Estagiária no Santander

Weekend Creative Agent Challenge: ABC Diário

Tags: #agents

Vision and what it does

ABC Diário is a small agent that checks the current temperature in the ABC Paulista region (São Paulo, Brazil) and turns it into a poem. When you open the page, it shows the poem, the date, and the temperature for the day. There's no need to trigger anything manually — the agent is set up to run on its own every morning at 8am, with no human intervention.

How I built it

I chose this architecture because Lambda is the simplest way to run code that doesn't need to stay on all the time — it only executes when triggered. I paired it with EventBridge Scheduler, which is responsible for calling the Lambda every day at the right time, and used S3 to store the generated results. The static page then reads the latest saved poem from S3 and displays it.
One important decision was to always keep the most recent poem in a single fixed file ( latest.json ), instead of having the page search through multiple date-organized files to figure out which one is "today's." This keeps the read fast and simple.
I also had to choose between Amazon Bedrock and Gemini as the AI model responsible for generating the poems — a decision I explain in more detail in the challenges section below.

Challenges I faced

The biggest challenge was trying to use Amazon Bedrock and running into a known provisioning bug: new AWS accounts are being created with their token quota stuck at 0, even after model access is approved and Free Tier credits are available. Every call returned a "too many tokens per day" error. After researching, I found this is a widely reported issue in the AWS community, and that fixing it through support can take days — not workable given the challenge deadline.
Because of that, I decided to move content generation to the Gemini API (Google AI Studio), which offers a free tier that doesn't require a credit card, unlike other AI APIs I considered. The rest of the architecture kept running entirely on AWS services.
After that switch, I hit a second problem: the Lambda was configured with the default 3-second timeout, which wasn't enough for the network calls involved (fetching the weather and generating the poem), causing it to fail. I fixed this by increasing the function's timeout to 30 seconds.
Along the way I also had to fix a "bucket does not exist" error and a permissions error (the Lambda's execution role wasn't authorized to write to S3) — both resolved by adjusting the IAM configuration and reading through the execution logs in CloudWatch.

AWS services used and architecture

  • AWS Lambda — runs the Python code that fetches the weather, generates the poem via the Gemini API, and saves the result.
  • Amazon EventBridge Scheduler — automatically triggers the Lambda every day at 8am (Brazil time), with no manual action needed.
  • Amazon S3 — serves two roles: it stores the generated files (a per-day history plus the always-current  latest.json ) and hosts the static page ( index.html ) that displays the result publicly.
Flow: EventBridge triggers the Lambda → the Lambda fetches the current temperature for ABC Paulista → it builds a prompt and calls the Gemini API → the generated poem is saved to S3 → the static page, hosted in the same bucket, fetches the latest file and displays the poem, date, and temperature to visitors.

What I learned

I got a much better understanding of how Lambda works, along with the trade-offs between developing locally before deploying versus writing directly in the console editor to move faster. I also learned a lot about IAM permissions — the difference between attaching a pre-built policy and creating an inline policy scoped to exactly what the function needs, following the principle of least privilege.
On top of that, this whole process reinforced how important log reading (CloudWatch) is as a debugging practice — a skill I keep building on, and one that was essential for identifying each error along the way while building this agent.

Project link

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