All Projects â†’ softprops â†’ serverless-aws-rust-http

softprops / serverless-aws-rust-http

Licence: other
⚡🏗ī¸ template for new aws lambda serverless rust http apps

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to serverless-aws-rust-http

Aws Lambda Vpc Nat Examples
Example of setting up AWS lambda function with VPC and NAT
Stars: ✭ 92 (+8.24%)
Mutual labels:  lambda, serverless-framework
telegram-stepfunctions-bot
Serverless Telegram bot made on 4 AWS Lambda chained by AWS Step Functions. All of this written on Serverless Framework using plugins.
Stars: ✭ 26 (-69.41%)
Mutual labels:  lambda, serverless-framework
Json Serverless
Transform a JSON file into a serverless REST API in AWS cloud
Stars: ✭ 108 (+27.06%)
Mutual labels:  lambda, serverless-framework
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-40%)
Mutual labels:  lambda, serverless-framework
Serverless Chrome
🌐 Run headless Chrome/Chromium on AWS Lambda
Stars: ✭ 2,625 (+2988.24%)
Mutual labels:  lambda, serverless-framework
Serverless Node Simple Image Resize
Simple image resize AWS lambda function
Stars: ✭ 74 (-12.94%)
Mutual labels:  lambda, serverless-framework
Serverless Next.js
⚡ Deploy your Next.js apps on AWS Lambda@Edge via Serverless Components
Stars: ✭ 2,977 (+3402.35%)
Mutual labels:  lambda, serverless-framework
Puppeteer Lambda Starter Kit
Starter Kit for running Headless-Chrome by Puppeteer on AWS Lambda.
Stars: ✭ 563 (+562.35%)
Mutual labels:  lambda, serverless-framework
Aws Auto Remediate
Open source application to instantly remediate common security issues through the use of AWS Config
Stars: ✭ 191 (+124.71%)
Mutual labels:  lambda, serverless-framework
Components
The Serverless Framework's new infrastructure provisioning technology — Build, compose, & deploy serverless apps in seconds...
Stars: ✭ 2,259 (+2557.65%)
Mutual labels:  lambda, serverless-framework
Lambda Coding Round Evaluator
lambda-coding-round-evaluator is a Serverless application to automate coding round submission and evaluation. It helps you get rid of emails and easily filter out bad candidates. Yay!
Stars: ✭ 43 (-49.41%)
Mutual labels:  lambda, serverless-framework
serverless-email-scheduler
Schedule future emails with AWS Lambda and Step Functions
Stars: ✭ 29 (-65.88%)
Mutual labels:  lambda, serverless-framework
Chalice
Python Serverless Microframework for AWS
Stars: ✭ 8,513 (+9915.29%)
Mutual labels:  lambda, serverless-framework
Serverless Node Simple Messaging
Simple email AWS lambda function
Stars: ✭ 75 (-11.76%)
Mutual labels:  lambda, serverless-framework
Serverless Appsync Plugin
serverless plugin for appsync
Stars: ✭ 804 (+845.88%)
Mutual labels:  lambda, serverless-framework
Serverless Sam
Serverless framework plugin to export AWS SAM templates for a service
Stars: ✭ 143 (+68.24%)
Mutual labels:  lambda, serverless-framework
Serverless Express
Run Node.js web applications and APIs using existing application frameworks on AWS #serverless technologies such as Lambda, API Gateway, Lambda@Edge, and ALB.
Stars: ✭ 4,265 (+4917.65%)
Mutual labels:  lambda, serverless-framework
Webiny Js
Enterprise open-source serverless CMS. Includes a headless CMS, page builder, form builder and file manager. Easy to customize and expand. Deploys to AWS.
Stars: ✭ 4,869 (+5628.24%)
Mutual labels:  lambda, serverless-framework
Zappa
Serverless Python
Stars: ✭ 11,859 (+13851.76%)
Mutual labels:  lambda, serverless-framework
serverless-plugin-epsagon
Epsagon's plugin for Serverless Framework ⚡ī¸
Stars: ✭ 53 (-37.65%)
Mutual labels:  lambda, serverless-framework

serverless AWS Rust HTTP template

A sample template for bootstraping Rustlang AWS Lambda HTTP applications with ⚡ serverless framework ⚡.

✨ features

  • đŸĻ€ Build Rustlang applications targeting AWS Lambda with ease
  • đŸ›ĩ Continuous integration testing with GitHub Actions
  • 🚀 Continuous deployment with GitHub Actions
  • đŸ§Ē Getting started tests

đŸ“Ļ install

Install the serverless framework cli.

Then then run the following in your terminal

$ npx serverless install \
  --url https://github.com/softprops/serverless-aws-rust-http \
  --name my-new-api

This will download the source of a sample Rustlang application and unpack it as a new service named "my-new-api" in a directory called "my-new-api"

🧙 how to be a wizard

Assuming you have aws credentials with appropriate deployment permissions configured (if you already use any existing AWS tooling installed you likely already have this configured), you can impress your friends by creating a project that is born in a production environment.

$ npx serverless install \
  --url https://github.com/softprops/serverless-aws-rust-http \
  --name my-new-api \
  && cd my-new-api \
  && npm i \
  && npx serverless deploy

npm i will make sure npm dependencies are installed. This only needs run once. The first time you run npx serverless deploy it will pull down and compile the base set of dependencies and your application. Unless the dependencies change afterwards, this should only happen once, resulting in an out of the box rapid deployment cycle.

đŸ›ĩ continuous integration and deployment

This template includes an example GitHub actions configuration file which can unlock a virtuous cycle of continuous integration and deployment ( i.e all tests are run on prs and every push to master results in a deployment ).

GitHub actions is managed simply by the presence of a file checked into your repository. To set up GitHub Actions to deploy to AWS you'll need to do a few things

Firstly, version control your source. Github is free for opensource.

$ git init
$ git remote add origin [email protected]:{username}/{my-new-service}.git

Store a AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY used for aws deployment in your repositories secrets https://github.com/{username}/{my-new-service}/settings/secrets

Add your changes to git and push them to GitHub.

Finally, open https://github.com/{username}/{my-new-service}/actions in your browser and grab a bucket of popcorn đŸŋ

đŸ”Ģ function triggering

With your function deployed you can now start triggering it using serverless framework directly or the AWS integration you've configured to trigger it on your behalf

Copy this sample apigateway request into a file called payload.json

{
  "path": "/test/hello",
  "headers": {
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
    "Accept-Encoding": "gzip, deflate, lzma, sdch, br",
    "Accept-Language": "en-US,en;q=0.8",
    "CloudFront-Forwarded-Proto": "https",
    "CloudFront-Is-Desktop-Viewer": "true",
    "CloudFront-Is-Mobile-Viewer": "false",
    "CloudFront-Is-SmartTV-Viewer": "false",
    "CloudFront-Is-Tablet-Viewer": "false",
    "CloudFront-Viewer-Country": "US",
    "Host": "wt6mne2s9k.execute-api.us-west-2.amazonaws.com",
    "Upgrade-Insecure-Requests": "1",
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 OPR/39.0.2256.48",
    "Via": "1.1 fb7cca60f0ecd82ce07790c9c5eef16c.cloudfront.net (CloudFront)",
    "X-Amz-Cf-Id": "nBsWBOrSHMgnaROZJK1wGCZ9PcRcSpq_oSXZNQwQ10OTZL4cimZo3g==",
    "X-Forwarded-For": "192.168.100.1, 192.168.1.1",
    "X-Forwarded-Port": "443",
    "X-Forwarded-Proto": "https"
  },
  "pathParameters": {
    "proxy": "hello"
  },
  "requestContext": {
    "accountId": "123456789012",
    "resourceId": "us4z18",
    "stage": "test",
    "requestId": "41b45ea3-70b5-11e6-b7bd-69b5aaebc7d9",
    "identity": {
      "cognitoIdentityPoolId": "",
      "accountId": "",
      "cognitoIdentityId": "",
      "caller": "",
      "apiKey": "",
      "sourceIp": "192.168.100.1",
      "cognitoAuthenticationType": "",
      "cognitoAuthenticationProvider": "",
      "userArn": "",
      "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 OPR/39.0.2256.48",
      "user": ""
    },
    "resourcePath": "/{proxy+}",
    "httpMethod": "GET",
    "apiId": "wt6mne2s9k"
  },
  "resource": "/{proxy+}",
  "httpMethod": "GET",
  "queryStringParameters": {
    "name": "me"
  },
  "stageVariables": {
    "stageVarName": "stageVarValue"
  }
}

Then invoke your function with a synthetic request

$ npx serverless invoke -f hello -d "$(cat payload.json)"

đŸ”Ŧ logs

With your function deployed you can now tail it's logs right from your project

$ npx serverless logs -f hello

👴 retiring

Good code should be easily replaceable. Good code is should also be easily disposable. Retiring applications should be as easy as creating and deploying them. The dual of serverless deploy is serverless remove. Use this for retiring services and cleaning up resources.

$ npx serverless remove

ℹī¸ additional information

đŸ‘¯ contributing

This template's intent is to set a minimal baseline for getting engineers up an running with a set of repeatable best practices. See something you'd like in this template that would help others? Feel free to open a new github issue. Pull requests are also welcome.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].