A ⚡ Serverless framework ⚡ plugin for Rustlang applications 🦀
Install the plugin with npm
$ npm install [email protected]💡 This serverless plugin assumes you are building Rustlang lambdas using the lando or crowbar rustlang crates.
Add the following to your serverless project's serverless.yml file
service: demo
provider:
name: aws
# crowbar and lando integrate with aws lambda's python3.6 runtime
runtime: python3.6
plugins:
# this adds informs servleress to use
# the serverless-rust plugin
- serverless-rust
# the follow is recommended for small deployment sizes
# (faster uploads)
package:
individually: true
exclude:
- ./**
functions:
test:
# liblambda.handler is the default function name when
# you follow lando/crowbar conventions
handler: liblambda.handler
# the following limits the function packaging
# to just the resulting binary
package:
include:
- liblambda.so
events:
- http:
path: /test
method: GETYou can optionally adjust the default settings of the dockerized build env using a custom section of your serverless.yaml configuration
custom:
# this section customizes the default
# serverless-rust plugin settings
rust:
# flags passed to cargo
cargoFlags: '--features lando/python3-sys'
# custom docker tag
dockerTag: 'some-custom-tag'If your serverless project contains multiple functions, you may sometimes
need to customize the options above at the function level. You can do this
by defining a rust key with the same options inline in your function
specficiation.
functions:
test:
rust:
# function specific flags passed to cargo
cargoFlags: '--features ...'
# liblambda.handler is the default function name when
# you follow lando/crowbar conventions
handler: liblambda.handler
# the following limits the function packaging
# to just the resulting binary
package:
include:
- liblambda.so
events:
- http:
path: /test
method: GET- lando api gateway application - https://github.com/softprops/serverless-lando
- multi function lando api gateway application - https://github.com/softprops/serverless-multi-lando
- crowbar cloudwatch scheduled lambda application - https://github.com/softprops/serverless-crowbar