Giter Site home page Giter Site logo

angelmunoz / mandabot Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 133 KB

F# and AWS Lambda. A simple and effective way to go into serverless territory with the language you love

License: MIT License

PowerShell 0.81% F# 99.19%
fsharp aws aws-lambda dotnet telegram-bot

mandabot's Introduction

F# + AWS Lambda

Disclaimer

I'm no serverless/lambda expert, I'm just a guy that found really easy to get started with AWS lambda using .NET specially F#

This is a simple F# lambda function that is used together with API Gateway and serves as the webhook for a Telegram Bot lambda config

I added the API Gateway manually inside the AWS Console, Lambdas can also be invoked for a number of events inside AWS services, API Gateway, like S3, DynamoDB, etc, etc

Requirements

To create templates, deploy and work with .Net lambdas easily you need the following stuff

you can also find the full suite of tools in the aws dotnet repository

Tests are simple to execute simply do

dotnet test tests/Mandabot.Tests

Even though I've been basically debuging live hiting the endpoint and sending messages to the bot and letting telegram handle the update event mandadinbot

Also please be advised this bot+lambda is not connected to a database, the main purpose was to actually figure out the lambda development and deployment

Deploying

Deploying is super simple, just update the aws-lambda-tools-defaults.json with your data (profile and region) then simply type

cd src/Mandabot
dotnet lambda deploy-function NAME_OF_YOUR_FUNCTION

the CLI will try to figure out if there's something missing with your configuration and prompt you if necessary if everything is fine it will deploy your Lambda Function in a few seconds and that's it your Lambda is live to start testing with it

Invoking

Invoking your function is really easy as well

cd src/Mandabot
dotnet lambda invoke-function NAME_OF_YOUR_FUNCTION --payload "{ \"my-json\": \"object\" }"

mandabot's People

Contributors

angelmunoz avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.