mrserverless / serverless-golang

AWS Lambda Go functions using Serverless Framework and Python shim
Other
302 stars 21 forks source link

examples for adding using plugins #21

Closed kmarquardsen closed 6 years ago

kmarquardsen commented 7 years ago

how would you include something from https://github.com/serverless/plugins?

cristim commented 7 years ago

I didn't use plugins before but I think there should be no difference, you just have to add them to the serverless yaml configuration file.

kmarquardsen commented 7 years ago

I think my confusion is that most of the plugins setup instructions involve a npm --save-dev

mrserverless commented 7 years ago

We are using a few plugins such cloudwatch log forwarders, I can put up some example code.

mrserverless commented 7 years ago

but @cristim is right, you should be able to just put them in the serverless.yml

mrserverless commented 6 years ago

Currently my teams at work are using https://github.com/amplify-education/serverless-log-forwarding in production with serverless-golang. With the following syntax:

plugins:
  - serverless-log-forwarding

custom:
  logForwarding:
    destinationARN: {"Fn::ImportValue": "${env:SUMOLOGIC_LAMBDA_ARN_EXPORT_NAME}"}

And the destination lambda is https://github.com/amaysim-au/serverless-sumologic. Of course you can point this to your own lambda and use a full ARN instead of the Cloudformation ImportValue.

I'm not sure if they did use npm install since it wasn't specified in their Makefile. But the yunspace/serverless-golang container does have node runtime if needed. I'm going to close this for now since whichever plugin I choose as an example will involve various external setup which are outside the scope of this library.

Feel free to raise a issue if a specific plugin doesn't work as expected with this library.