
Weekend Showcase Challenge: Cosmic Postcard
An autonomous AI agent that transforms NASA’s Astronomy Picture of the Day into a unique daily cosmic postcard using AWS Lambda, Amazon Bedrock, and Amazon S3.
Series: WeekEnd-Challenges (7 articles)
- …
- 5Weekend Showcase Challenge: Cosmic Postcard This article
What if NASA’s Astronomy Picture of the Day could become more than an image and a scientific description? What if an autonomous AI agent could discover the image, interpret it creatively, and publish a new digital postcard every day without manual intervention?
That idea became Cosmic Postcard — an autonomous creative agent that combines NASA’s Astronomy Picture of the Day with generative AI and AWS serverless services to create a new cosmic postcard every day.
🌌 Vision and What It Does
The vision behind Cosmic Postcard is to create a simple, continuously evolving experience around the universe. NASA already provides incredible daily discoveries through APOD, but the experience is primarily focused on presenting the scientific information and image.
Cosmic Postcard adds a creative layer on top of that data.
Every day, an automated workflow retrieves the latest NASA Astronomy Picture of the Day, sends the discovery information to Amazon Bedrock, and asks the model to create a short creative postcard. The generated content includes a postcard title, a poetic message, and an agent reflection.
The result is then stored in Amazon S3 and displayed through a web application.
The workflow looks like:
1
2
3
4
5
6
7
8
9
10
11
Amazon EventBridge
↓
AWS Lambda
↓
NASA APOD
↓
Amazon Bedrock
↓
Amazon S3
↓
Web ApplicationFor example, one NASA discovery was “The Sky Turns Above Paranal.” The agent transformed the discovery into a postcard titled “Whispers of Paranal”, with a short poetic interpretation and a reflection about Earth's rotation and the night sky.
The scientific NASA description remains available alongside the AI-generated content, so the creative layer complements rather than replaces the original discovery.
🛠️ How I Built It
I started by designing the project around a simple principle: the application should require as little manual intervention as possible.
The first part was connecting the application to NASA's APOD data. The Lambda function retrieves the daily discovery information and downloads the corresponding image.
Next, I integrated Amazon Bedrock into the workflow. Instead of using a generic chatbot-style interaction, I structured the model request around the NASA discovery and asked it to produce a predictable set of creative fields: title, postcard, and reflection.
The generated result is combined with the NASA metadata into a JSON document.
Amazon S3 stores two important outputs:
1
2
latest.json
latest.jpgThe frontend then reads
latest.json and dynamically renders the latest postcard.One of the challenges during development was connecting the different parts of the system correctly. I had to work through Lambda execution permissions, S3 access, browser CORS behavior, Function URL configuration, and the EventBridge trigger.
At one point, the backend was successfully generating the postcard and saving it to S3, while the frontend was unable to retrieve the data because of access configuration. Debugging the browser console, Lambda responses, S3 access, and CloudWatch logs helped identify where the problem existed instead of assuming the entire application was broken.
That was an important part of the build: observability made debugging much easier.
☁️ AWS Services and Architecture
The project uses several AWS services, each with a specific role.
AWS Lambda is the core execution environment. It runs the postcard-generation workflow without requiring a continuously running server.
Amazon EventBridge triggers the Lambda function on a daily schedule. The configured rule is:
1
cosmic-postcard-dailyAmazon Bedrock provides the generative AI capability. It takes the NASA discovery as context and generates the creative postcard content.
Amazon S3 acts as the storage layer. The Lambda function stores the latest NASA image and generated JSON data there.
Amazon CloudWatch provides logging and monitoring for the Lambda execution. This was especially useful during development because I could see each stage of the workflow and verify successful executions.
The frontend is a lightweight application built with HTML, CSS, and JavaScript. It retrieves the latest JSON data and presents it as the Cosmic Postcard interface.
The overall architecture is therefore:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
┌──────────────────┐
│ Amazon EventBridge│
│ Daily Schedule │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ AWS Lambda
│ Cosmic Postcard│
│ Agent │
└───────┬──────────┘
│
┌──────────┴──────────┐
▼ ▼
┌─────────────┐ ┌─────────────┐
│ NASA APOD │ │ Bedrock │
│ Discovery │ │ Generation │
└──────┬──────┘ └──────┬──────┘
│ │
└──────────┬──────────┘
▼
┌──────────────────┐
│ Amazon S3 │
│ latest.json │
│ latest.jpg │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ Cosmic Postcard │
│ Web App │
└──────────────────┘📚 What I Learned Across the Summer
One of my biggest takeaways from building this project was that building an AI application is much more than calling an AI model.
The model is only one component of the system.
I learned how important it is to think about the complete lifecycle:
trigger → data → processing → AI generation → storage → delivery → monitoring.
Working with AWS Lambda helped me understand serverless application design and how event-driven workflows can remove the need for traditional always-running backend servers.
Working with Amazon Bedrock gave me practical experience integrating generative AI into an actual application rather than using it as an isolated experiment.
I also learned a lot from debugging. CORS errors, permissions, S3 policies, Lambda Function URLs, EventBridge invocation, and CloudWatch logs were not just configuration details — they showed me how different cloud components interact and where failures can occur between services.
Most importantly, this project changed how I think about autonomous applications. A useful AI agent isn't necessarily a complicated system. Even a relatively small workflow can become autonomous when it can receive a trigger, retrieve information, make a decision or generate content, persist the result, and continue operating without manual intervention.
🚀 Try the Working Demo
The live application is available here:
The application displays the latest postcard generated by the autonomous workflow.
💻 Source Code
The complete project is available on GitHub:
The repository contains the frontend and project documentation.
🌠 What's Next?
There are several possibilities for extending Cosmic Postcard:
- Building a historical archive of generated postcards
- Allowing users to explore previous NASA discoveries
- Adding different creative styles for the AI agent
- Sending the postcard through email
- Adding social sharing
- Using Amazon CloudFront for a more production-ready delivery architecture
- Expanding the agent to create different interpretations of astronomical discoveries
For this project, however, the goal was simple:
Build something that wakes up every day, looks at the universe, and writes a postcard about what it finds.
And now it does.
Inspired by: @benfowleraws - for creating the Weekend Challenge and encouraging builders to turn their summer projects into something worth sharing.

s3-b

eventbridge

IAM-R

lambda

final
Series: WeekEnd-Challenges (7 articles)
- …
- 5Weekend Showcase Challenge: Cosmic Postcard This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article