• Documentation
  • Pricing
© 2026 Serverless, Inc. All rights reserved.

Framework

  • Overview
  • Documentation
  • Plugins360
  • Pricing

Learn

  • Blog
  • GuidesUpdated
  • Examples240
  • Courses

Resources

  • Support
  • Security
  • Trust Center
  • Status

Community

  • Slack
  • GitHub47k
  • Forum
  • Meetups

Company

  • About
  • Careers
  • Contact
  • Partners

Legal

  • Terms of Service
  • Privacy Policy
  • Trademark
  • DMCA
icarus-sullivan

Serverless Plugin Staging

by

A plugin to restrict the deployment of resources or functions on a per stage basis

0
2
  1. Serverless Plugin Staging

Serverless Staging

Downloads Version License

A plugin to restrict the deployment of resources or functions on a per stage basis.

Installation

npm install serverless-plugin-staging --save-dev

or

yarn add serverless-plugin-staging --dev

Usage

In your project's serverless file, add serverless-plugin-staging within the plugins entry.

Example:

plugins:
  - serverless-plugin-staging

Configuration

To restrict which assets are deployed within a stage, create a custom variable named staging. Within that staged variable, excludeFunctions will be used to control what functions are ignored during a deployment, and the excludeResources to control the resources.

Example excluding the function prodFunctionHandler from deploying on beta stage

custom:
  staging:
    excludeFunctions:
      beta: 
        - prodFunctionHandler

Example excluding the Uploads S3 Bucket from deploying on beta stage

custom: 
  staging:
    excludeResources:
      beta:
        - UploadsBucket

Complete Example

service: serverless-plugin-staging-example

custom: 
  staging:
    excludeFunctions:
      beta:
        - prodFunctionHandler
    excludeResources:
      beta:
        - UploadsBucket

provider:
  name: aws
  runtime: nodejs8.10
  region: us-west-2 

functions:
  prodFunctionHandler:
    handler: handlers.prodLambda
  normalFunctionHandler:
    handler: handlers.normalLambda

resources: 
  Resources:
    UploadsBucket:
      Type: AWS::S3::Bucket
      Properties:
        BucketName: Uploads

plugins:
  - serverless-plugin-staging

Contents

  • Serverless Staging
  • A plugin to restrict the deployment of resources or functions on a per stage basis.
  • Installation
  • Usage
  • Configuration

Related

GuidesPluginsExamplesSlack CommunitySupport