Skip to content

antlko/go-telegram-aws-lambda-with-heroku-db

Repository files navigation

Golang Telegram BOT with AWS lambda and Heroku PostgresDB

Telegram BOT boilerplate is a bot with heroku PostgresDB and simple PostgresDB connection and deploying to AWS lambda possibility.

Installation

Initialize serverless with the command below:

serverless

Download golang dependencies

go mod download

Create .env file with required attributes:

cp .env.dist .env
cp .env.local.dist .env.local

Usage

Main settings

API_TOKEN - bot token from created bot with BotFather in the Telegram

HEROKU_IS_ACTIVE - configuration for switching between heroku and simple PostgresDB

HEROKU_API_KEY - secret key from Heroku account (on the site: Profile -> Account Settings -> API Key)

HEROKU_POSTGRES_ID - PostgresDB ID

In order to check all addons from heroku and hastily check Postgres ID run command below:

heroku addons

Other information here Heroku PostgreSQL

Run

Local usage

go run applocal/main.go

Deploy to AWS lambda

At first set up credentials from Identity and Access Management (IAM) user.

export AWS_SECRET_ACCESS_KEY=<your_secret_key>
export AWS_ACCESS_KEY_ID=<your_access_key>

Build application

make build

or immediately deploy it

make deploy

About

Golang Telegram BOT with AWS lambda boilerplate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published