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
Size: 363
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Serverless plugin that publishes your functions and subscriptions to Hosted Event Gateway.
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!
Looking for an example to get started? Check out the Getting Started Example to deploy your first service to the Event Gateway.
Create a new Serverless service and change into the directory.
Install the plugin: (needs Node version 7+)
m install --save-dev @serverless/serverless-event-gateway-plugin
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
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
Deploy, then invoke your function(s):
sls deploy
curl -X GET https://myspace.slsgateway.com/hello
rl -X GET https://myspace.slsgateway.com/goodbye
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 ?
?????????????????????????????????????????????????????????????????????????
Core concepts:
Event concepts:
Auth concepts:
https://myorg-my-app.slsgateway.com
.