Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS AI Telegram Bot

A Telegram bot that controls your AWS EC2 server using plain English commands powered by Claude AI on Amazon Bedrock. No SSH, no terminal, just a message.


What It Does

Send a natural language message to the bot and it will:

  1. Forward your message to Claude Haiku 4.5 on Amazon Bedrock
  2. Claude decides what Linux command to run
  3. AWS Lambda runs the command on EC2 via AWS Systems Manager without SSH or stored keys
  4. If the command fails, Claude figures out why and tries a different approach
  5. The loop continues up to 10 iterations until the task is complete
  6. Claude summarizes the final result in plain English and the bot replies

Progress updates appear live in the chat so you can see what the bot is doing at each step.


Architecture

Architecture Diagram


Example Conversations

Server health check: User: hows my server doing? Bot: Your server is doing great! Uptime 7 days 19 hours, load average 0.07 (very light), memory at 42%, disk at 51%. Everything looks normal and stable.

Web scraping: User: write a python script that fetches https://news.ycombinator.com using requests and prints the titles of the first 5 stories, then run it and tell me the first 5 stories Bot: The bot wrote the script, ran it, and returned live Hacker News headlines including "Xiaomi: New CPU matches Apple cores single threaded" and "MS Paint and Photos invisibly watermark even locally generated output with GUID".

Multi step installation: User: install python selenium on the server system wide Bot: The bot handled PEP 668 restrictions automatically, installed selenium 4.47.0 system wide, verified the installation, and confirmed it is ready to use with import selenium.


Tech Stack

  • AWS Lambda
  • Amazon Bedrock
  • Claude Haiku 4.5
  • AWS Systems Manager (SSM)
  • AWS EC2
  • Telegram Bot API
  • Python 3.13

Environment Variables

Configure these in your Lambda function under Configuration > Environment variables:

Variable Description
TELEGRAM_BOT_TOKEN Your Telegram bot token from BotFather
INSTANCE_ID The EC2 instance ID to control

Setup

See docs/setup.md for full step by step setup instructions.


Project Structure

aws-ai-telegram-bot/
├── README.md
├── lambda/
│   └── handler.py
├── architecture/
│   └── diagram.png
└── docs/
    └── setup.md

About

AI-powered Telegram bot that controls AWS EC2 using plain English. Claude AI translates natural language into Linux commands, executes them via AWS Systems Manager, and replies with a plain English summary. Supports multi-step agentic tasks with live progress updates.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages