AWS Builder Center
Weekend Agent Challenge: Building an Autonomous AI-Powered Daily Share Market Agent Using Amazon Bedrock, AWS Lambda, EventBridge Scheduler, and Amazon SES

Weekend Agent Challenge: Building an Autonomous AI-Powered Daily Share Market Agent Using Amazon Bedrock, AWS Lambda, EventBridge Scheduler, and Amazon SES

In this project, I built an autonomous AI agent that automatically generates a daily Indian stock market report using Amazon Bedrock and delivers it to my email every morning using Amazon SES. The workflow is fully automated with AWS Lambda and EventBridge Scheduler.

Problem Statement

Checking the stock market manually every morning takes time.
I wanted to build an AI agent that:
  • Runs automatically every morning
  • Generates a market summary using Generative AI
  • Sends the report directly to my email
  • Requires no manual intervention



AWS Services Used

AWS Service
Purpose
Amazon Bedrock
Generates the AI stock market report
AWS Lambda
Executes the Python code
Amazon EventBridge Scheduler
Runs the Lambda function automatically every day at 6:00 AM
Amazon SES
Sends the report to my email
AWS IAM
Manages permissions
Amazon CloudWatch
Stores execution logs



Solution Architecture

Amazon EventBridge Scheduler
│
▼
AWS Lambda
│
▼
Amazon Bedrock (Nova Lite)
│
▼
Generate Daily Market Report
│
▼
Amazon SES
│
▼
Email Delivered Automatically



Implementation Steps

Step 1: Create the Lambda Function

I created a Python 3.12 Lambda function.
The Lambda function:
  • Creates a Bedrock Runtime client
  • Sends a prompt to Amazon Nova Lite
  • Receives the generated report
  • Sends the report using Amazon SES



Step 2: Configure Amazon Bedrock

I selected the Amazon Nova Lite model.
Prompt used:
Generate a short Indian stock market morning report containing:* Market Overview
  • Top 3 Sectors to Watch
  • General Trading TipsKeep it under 200 words.



Step 3: Configure IAM Permissions

The Lambda execution role was granted permissions for:
  • bedrock:InvokeModel
  • ses:SendEmail
  • CloudWatch Logs
This allowed Lambda to communicate securely with Bedrock and SES.



Step 4: Verify Email Using Amazon SES

I verified my email address in Amazon SES.
After verification, Lambda was able to send emails automatically.



Step 5: Schedule Automatic Execution

Using Amazon EventBridge Scheduler, I created a recurring schedule.
Cron Expression:
cron(0 6 * * ? *)
This runs every day at 6:00 AM (Asia/Kolkata).



Lambda Workflow

The Lambda function performs the following steps:
  1. Triggered by EventBridge.
  1. Sends a prompt to Amazon Bedrock Nova Lite.
  1. Receives the AI-generated market report.
  1. Sends the report to my email using Amazon SES.
  1. CloudWatch records execution logs.



Example Email

Subject
📈 Daily Share Market Report
Example contents:
  • Market Overview
  • Top Sectors to Watch
  • Trading Tips
  • AI-generated market summary
The report arrives automatically every morning.



Challenges Faced

During development I encountered several issues:

Bedrock Permission Error

Initially Lambda returned:
AccessDeniedException
This was solved by adding the required IAM permission:
bedrock:InvokeModel



SES Email Verification

Amazon SES requires the sender email address to be verified before emails can be sent.
After verifying the email identity, email delivery worked successfully.



Event Scheduling

I configured EventBridge Scheduler using a cron expression to automate execution every morning.



Results

The final solution successfully:
  • Automatically runs every day
  • Generates AI-powered market insights
  • Sends reports directly to email
  • Executes without any manual interaction
This demonstrates how AWS serverless services and Generative AI can be combined to build autonomous assistants.



Future Improvements

Possible enhancements include:
  • Fetch live market prices from financial APIs
  • Save reports in Amazon S3
  • Send notifications through Telegram or Slack
  • Create a dashboard for historical reports
  • Add personalized investment preferences



Conclusion

This project helped me understand how to integrate Amazon Bedrock with AWS Lambda, EventBridge Scheduler, and Amazon SES to build a fully automated AI agent.
The solution is lightweight, serverless, scalable, and runs entirely on AWS managed services.



Tags

Use these five tags:
  • Amazon Bedrock
  • AWS Lambda
  • Amazon EventBridge
  • Amazon SES
  • Generative AI
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