serverless/serverless-event-gateway-plugin

Name: serverless-event-gateway-plugin

Owner: Serverless

Description: Event Gateway plugin for Serverless Framework

Created: 2018-01-29 12:16:21.0

Updated: 2018-05-04 12:03:50.0

Pushed: 2018-05-07 10:44:04.0

Homepage:

Size: 363

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Event Gateway plugin for Serverless Framework

Serverless plugin that publishes your functions and subscriptions to Hosted Event Gateway.

Setup

This is best used with the hosted version of the Event Gateway provided by Serverless, Inc. as a fully-managed service.

After you create an account, you'll need two things: an Access Key and an Application URL.

Get an Access Key in the Access Control section, and save it to your clipboard:

Then, grab the URL for one of your Applications:

Finally, save both of these to your serverless.yml:

rverless.yml

om:
entgateway:
url: tenant-yourapp.slsgateway.com
accessKey: AKmyKey1234


You're all set!

Example

Looking for an example to get started? Check out the Getting Started Example to deploy your first service to the Event Gateway.

Usage
  1. Create a new Serverless service and change into the directory.

  2. Install the plugin: (needs Node version 7+)

    m install --save-dev @serverless/serverless-event-gateway-plugin
    
  3. Enter the necessary plugin and config in serverless.yml:

    rverless.yml
    
    ice: my-service
    
    om:
    entgateway:
    url: myorg-app.slsgateway.com
    accessKey: <yourkey>
    To use self-hosted Event Gateway, use the following
     url: http://localhost:4000
    
    ins:
    "@serverless/serverless-event-gateway-plugin"
    
    ider:
    me: aws
    ntime: python3.6
    age: dev
    gion: us-west-2
    
    
  4. Wire up functions with an eventgateway event type:

    rverless.yml
    
    tions:
    llo:
    handler: handler.hello
    events:
      - eventgateway:
          event: http
          path: /hello
          method: GET
    odbye:
    handler: handler.goodbye
    events:
      - eventgateway:
          event: http
          path: /goodbye
          method: GET
    
  5. Deploy, then invoke your function(s):

    sls deploy
    
    
    curl -X GET https://myspace.slsgateway.com/hello
    
    
    rl -X GET https://myspace.slsgateway.com/goodbye
    
    
  6. View your space configuration with sls gateway dashboard:

    s gateway dashboard
    
    t Gateway
    
    ce: myspace
    point: https://myspace.slsgateway.com
    
    tions
    ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
    nction Id                     ? Region    ? ARN                                                                            ?
    ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
    -service-dev-hello            ? us-east-1 ? arn:aws:lambda:us-east-1:111111111111:function:my-service-dev-hello            ?
    ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
    -service-dev-goodbye          ? us-east-1 ? arn:aws:lambda:us-east-1:111111111111:function:my-service-dev-goodbye          ?
    ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
    
    criptions
    ?????????????????????????????????????????????????????????????????????????
    ent  ? Function ID                     ? Method ? Path                  ?
    ?????????????????????????????????????????????????????????????????????????
    tp   ? my-service-dev-hello            ? GET    ? /myspace/hello        ?
    ?????????????????????????????????????????????????????????????????????????
    tp   ? my-service-dev-goodbye          ? GET    ? /myspace/goodbye      ?
    ?????????????????????????????????????????????????????????????????????????
    
Concepts

Core concepts:

Event concepts:

Auth concepts:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.