Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Serverless Slack bot

lielran
February 27, 2017

Serverless Slack bot

Serverless slack bot @Hibob

lielran

February 27, 2017
Tweet

More Decks by lielran

Other Decks in Technology

Transcript

  1. Private & Confidential 3 HR Bob in a nutshell Digital

    Broker & All in one cloud-based platform for SMEs
  2. Private & Confidential 4 Employee Engagement . Leveraging the platforms

    Buying power. Up-selling private insurance. Bob in a nutshell
  3. The Serverless framework Cli tool(Nodejs) Cloudformation based Supports multiple regions

    Supports multiple Stages per region Can deploy all(function) or only one of them Versioning and Rollback supported. Support environments variables for each environment
  4. Serverless.yml(config) file service: hello-lambda provider: name: aws runtime: nodejs4.3 #

    (Support LTS versions) functions: hello: handler: handler.hello memorySize: 1524 # optional, default is 1024 timeout: 10 # timeout in secs events: - http: #other events: S3, schedule, sns, DynamoDbStream, alexaSkill, IOT path: users/create method: get custom: FOO: BAR resources: … # CloudFormation resource templates
  5. The function • Event - event data to the handler

    • Context - runtime information • Callback - optional callback to return information to the caller
  6. Slack - Scopes 1. Webhook - url that you can

    post messages to 2. Command - invoke request for data (e.g /giphy ) 3. Bot - read your channel data
  7. Serverless Slack Service - Benefits Cost effective Fast development Infinite

    scale Easy setup Easy onboarding new team members
  8. Pitfall #3 - Node.Js On lambda Aws Lambda support only

    LTS version Keep the setup simple - avoid babel/webpack if you can
  9. Challenges Unit / Integration testing Debug Development flow in teams

    Service discovery Architecture Communication with other lambdas Cold starts Monitoring/Health checks