aiogram-aws-serverless-example icon indicating copy to clipboard operation
aiogram-aws-serverless-example copied to clipboard

Simple echo Telegram bot example on aiogram framework using AWS API Gateway & Lambda

Aiogram AWS serverless example

Supported python versions Telegram Bot API Aiogram AWS API Gateway AWS Lambda

Simple echo Telegram bot example on aiogram framework using AWS API Gateway & Lambda.

Deploy

Create deployment package

  • Clone this repository: git clone https://github.com/DavisDmitry/aiogram-aws-serverless-example.git
  • Change to the directory with the repository copy: cd aiogram-aws-serverless-example
  • Run create-package bash script: ./create-package.sh

Create, configure and deploy a Lambda function


(video)

Environment variables:

  • TOKEN: Bot API token from botfather
  • LOGGING_LEVEL: logging level (optional), default - info

Create and configure API Gateway entrypoint

  • Create and configure API Gateway entrypoint:


(video)

  • Set webhook for your bot: follow the link through your browser or using curl – https://api.telegram.org/bot{your_bot_api_token}/setWebhook?url={your_api_gateway_url}

Profit!