a ⚡ serverless framework plugin for 🦀 rustlang applications
Clone or download
Latest commit aa9d873 Dec 11, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.eslintrc init May 29, 2018
.gitignore ignore node modules dir Jun 3, 2018
.travis.yml ci May 29, 2018
CHANGELOG.md update changelog Dec 10, 2018
LICENSE init May 29, 2018
Makefile make workflow Jun 4, 2018
README.md update readme Dec 11, 2018
index.js tweeks Dec 10, 2018
package-lock.json update serverless Dec 6, 2018
package.json start moving toward 0.2 Dec 9, 2018

README.md

serverless rust Build Status npm

A ⚡ Serverless framework ⚡ plugin for Rustlang applications 🦀

📦 Install

Install the plugin with npm

$ npm install serverless-rust

💡 This serverless plugin assumes you are building Rustlang lambdas targetting the AWS Lambda "provided" runtime. The AWS Lambda Rust Runtime makes this easy.

Add the following to your serverless project's serverless.yml file

service: demo
provider:
  name: aws
  runtime: rust
plugins:
  # this adds informs servleress to use
  # the serverless-rust plugin
  - serverless-rust
# creates one artifact for each function
package:
  individually: true
functions:
  test:
    # handler value syntax is `{cargo-package}.{bin-name}`
    # or `{bin-name}` for short when you are building a
    # default bin for a given package.
    handler: your-crate-name
    events:
      - http:
          path: /test
          method: GET

🖍️ customize

You can optionally adjust the default settings of the dockerized build env using a custom section of your serverless.yaml configuration

custom:
  # this section allows for customization of the default
  # serverless-rust plugin settings
  rust:
    # flags passed to cargo
    cargoFlags: '--features enable-awesome'
    # custom docker tag
    dockerTag: 'some-custom-tag'

🎨 Per function customization

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 enable-awesome'
    # handler value syntax is `{cargo-package}.{bin-name}`
    # or `{bin-name}` for short when you are building a
    # default bin for a given package.
    handler: your-crate-name
    events:
      - http:
          path: /test
          method: GET

🏗️ serverless templates

0.2.*

0.1.*

Older versions targeted the python 3.6 AWS Lambda runtime and rust crowbar and lando applications

Doug Tangren (softprops) 2018