All Projects → davidgf → Serverless Plugin Canary Deployments

davidgf / Serverless Plugin Canary Deployments

Licence: isc
Canary deployments for your Serverless application

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Serverless Plugin Canary Deployments

Serverless Sentry Plugin
This plugin adds automatic forwarding of errors and exceptions to Sentry (https://sentry.io) and Serverless (https://serverless.com)
Stars: ✭ 146 (-48.41%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework, serverless-plugin
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-81.98%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework, serverless-plugin
Serverless Aws Alias
Alias support for Serverless 1.x
Stars: ✭ 171 (-39.58%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework, lambda-functions
Serverless Plugin Git Variables
⚡️ Expose git variables to serverless
Stars: ✭ 75 (-73.5%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework, serverless-plugin
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 (+1620.49%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework, lambda-functions
Serverless Chrome
🌐 Run headless Chrome/Chromium on AWS Lambda
Stars: ✭ 2,625 (+827.56%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework, serverless-plugin
Serverlessbydesign
A visual approach to serverless development. Think. Build. Repeat.
Stars: ✭ 254 (-10.25%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Serverless Next.js
⚡ Deploy your Next.js apps on AWS Lambda@Edge via Serverless Components
Stars: ✭ 2,977 (+951.94%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
cloud-s4-sdk-pipeline-docker
The Cloud SDK continuous delivery infrastructure makes heavy use of docker images. This are the docker sources of these images.
Stars: ✭ 13 (-95.41%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment, ci-cd
Components
The Serverless Framework's new infrastructure provisioning technology — Build, compose, & deploy serverless apps in seconds...
Stars: ✭ 2,259 (+698.23%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Serverless Layers
Serverless.js plugin that implements AWS Lambda Layers which reduces drastically lambda size, warm-up and deployment time.
Stars: ✭ 119 (-57.95%)
Mutual labels:  aws, serverless, aws-lambda, serverless-plugin
Cartoonify
Deploy and scale serverless machine learning app - in 4 steps.
Stars: ✭ 157 (-44.52%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Retinal
🏙 Retinal is a Serverless AWS Lambda service for resizing images on-demand or event-triggered
Stars: ✭ 208 (-26.5%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Serverless Sam
Serverless framework plugin to export AWS SAM templates for a service
Stars: ✭ 143 (-49.47%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Aws Lambda List
A list of hopefully useful AWS lambdas and lambda-related resources.
Stars: ✭ 130 (-54.06%)
Mutual labels:  aws, serverless, aws-lambda, lambda-functions
Serverless Architectures Aws
The code repository for the Serverless Architectures on AWS book
Stars: ✭ 120 (-57.6%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Android-CICD
This repo demonstrates how to work on CI/CD for Mobile Apps 📱 using Github Actions 💊 + Firebase Distribution 🎉
Stars: ✭ 37 (-86.93%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment, ci-cd
Aws Lambda Typescript
This sample uses the Serverless Application Framework to implement an AWS Lambda function in TypeScript, deploy it via CloudFormation, publish it through API Gateway to a custom domain registered on Route53, and document it with Swagger.
Stars: ✭ 228 (-19.43%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Aws Serverless Samfarm
This repo is full CI/CD Serverless example which was used in the What's New with AWS Lambda presentation at Re:Invent 2016.
Stars: ✭ 271 (-4.24%)
Mutual labels:  aws, serverless, aws-lambda, ci-cd
Serverless Docker Image Resize
Simple serverless image resize on-the-fly - Deploy with one command - Built with AWS Lambda and S3
Stars: ✭ 114 (-59.72%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework

npm version

Serverless Plugin Canary Deployments

A Serverless plugin to implement canary deployments of Lambda functions, making use of the traffic shifting feature in combination with AWS CodeDeploy

Contents

Installation

npm i --save-dev serverless-plugin-canary-deployments

Usage

To enable gradual deployments for Lambda functions, your serverless.yml should look like this:

service: canary-deployments
provider:
  name: aws
  runtime: nodejs6.10
  iamRoleStatements:
    - Effect: Allow
      Action:
        - codedeploy:*
      Resource:
        - "*"

plugins:
  - serverless-plugin-canary-deployments

functions:
  hello:
    handler: handler.hello
    events:
      - http: GET hello
    deploymentSettings:
      type: Linear10PercentEvery1Minute
      alias: Live
      preTrafficHook: preHook
      postTrafficHook: postHook
      alarms:
        - FooAlarm          # When a string is provided, it expects the alarm Logical ID
        - name: BarAlarm    # When an object is provided, it expects the alarm name in the name property

  preHook:
    handler: hooks.pre
  postHook:
    handler: hooks.post

You can see a working example in the example folder.

Configuration

  • type: (required) defines how the traffic will be shifted between Lambda function versions. It must be one of the following:
    • Canary10Percent5Minutes: shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed five minutes later.
    • Canary10Percent10Minutes: shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed 10 minutes later.
    • Canary10Percent15Minutes: shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed 15 minutes later.
    • Canary10Percent30Minutes: shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed 30 minutes later.
    • Linear10PercentEvery1Minute: shifts 10 percent of traffic every minute until all traffic is shifted.
    • Linear10PercentEvery2Minutes: shifts 10 percent of traffic every two minutes until all traffic is shifted.
    • Linear10PercentEvery3Minutes: shifts 10 percent of traffic every three minutes until all traffic is shifted.
    • Linear10PercentEvery10Minutes: shifts 10 percent of traffic every 10 minutes until all traffic is shifted.
    • AllAtOnce: shifts all the traffic to the new version, useful when you only need to execute the validation hooks.
  • alias: (required) name that will be used to create the Lambda function alias.
  • preTrafficHook: (optional) validation Lambda function that runs before traffic shifting. It must use the CodeDeploy SDK to notify about this step's success or failure (more info here).
  • postTrafficHook: (optional) validation Lambda function that runs after traffic shifting. It must use the CodeDeploy SDK to notify about this step's success or failure (more info here)
  • alarms: (optional) list of CloudWatch alarms. If any of them is triggered during the deployment, the associated Lambda function will automatically roll back to the previous version.
  • triggerConfigurations: (optional) list of CodeDeploy Triggers. See more details in the CodeDeploy TriggerConfiguration Documentation, or this CodeDeploy notifications guide for example uses

Default configurations

You can set default values for all functions in a top-level custom deploymentSettings section. E.g.:

custom:
  deploymentSettings:
    codeDeployRole: some_arn_value
    codeDeployRolePermissionsBoundary: some_arn_value
    stages:
      - dev
      - prod

functions:
  ...

Some values are only available as top-level configurations. They are:

  • codeDeployRole: (optional) an ARN specifying an existing IAM role for CodeDeploy. If absent, one will be created for you. See the codeDeploy policy for an example of what is needed.
  • codeDeployRolePermissionsBoundary: (optional) an ARN specifying an existing IAM permissions boundary, this permission boundary is set on the code deploy that is being created when codeDeployRole is not defined.
  • stages: (optional) list of stages where you want to deploy your functions gradually. If not present, it assumes that are all of them.

How it works

The plugin relies on the AWS Lambda traffic shifting feature to balance traffic between versions and AWS CodeDeploy to automatically update its weight. It modifies the CloudFormation template generated by Serverless, so that:

  1. It creates a Lambda function Alias for each function with deployment settings.
  2. It creates a CodeDeploy Application and adds a CodeDeploy DeploymentGroup per Lambda function, according to the specified settings.
  3. It modifies events that trigger Lambda functions, so that they invoke the newly created alias.

Limitations

For now, the plugin only works with Lambda functions invoked by

  • API Gateway
  • Stream based (such as the triggered by Kinesis, DynamoDB Streams or SQS)
  • SNS based events
  • S3 events
  • CloudWatch Scheduled events
  • CloudWatch Logs
  • IoT rules

More events will be added soon.

License

ISC © David García

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].