npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

serverless-disable-apigateway-deployment

v1.0.4

Published

Prevent Serverless Framework from automatically creating API Gateway Deployment resources

Downloads

1,382

Readme

serverless-disable-apigateway-deployment

Disable automatic API Gateway REST deployments when using Serverless Framework.


🚨 Problem

Serverless Framework automatically creates and deploys an AWS::ApiGateway::Deployment whenever http events are defined.

This behavior:

  • Forces immediate API stage updates
  • Breaks centralized API deployment strategies
  • Makes shared API Gateways difficult in microservice architectures

There is no built-in way to disable this behavior.


✅ Solution

This plugin removes the generated AWS::ApiGateway::Deployment resource before CloudFormation is deployed.

Result:

  • API Gateway resources & methods are created
  • Stage is NOT updated
  • API changes go live only when YOU deploy them

📦 Installation

npm install --save-dev serverless-disable-apigateway-deployment

⚙️ Usage

Add the plugin to any Serverless service where you want to disable automatic API Gateway REST deployments.

plugins:
  - serverless-disable-apigateway-deployment

Deploy as usual:

serverless deploy

During deployment you will see logs like:

[serverless-disable-apigateway-deployment] Removed ApiGatewayDeployment123ABC

This confirms that the API Gateway deployment was successfully removed.

⚙️ Configuration

You can configure the plugin in your serverless.yml under the custom section.

custom:
  disableApiGatewayDeployment:
    logRemoved: true  # optional, default is true

Example:

service: example-service

provider:
  name: aws
  runtime: nodejs18.x

plugins:
  - serverless-disable-apigateway-deployment

custom:
  disableApiGatewayDeployment:
    logRemoved: true

functions:
  hello:
    handler: handler.hello

Options

| Option | Type | Default | Description | |------------|--------|---------|------------------------------------------------------------| | logRemoved | boolean | true | Enable or disable logging of removed API Gateway Deployment resources |

🏗️ Recommended Architecture (End-to-End)
This plugin is designed for shared API Gateway / microservice architectures.

1️⃣ api-core
Creates the shared API Gateway.

resources:
  Resources:
    SharedApi:
      Type: AWS::ApiGateway::RestApi
      Properties:
        Name: shared-api

Deploy once to create the API Gateway.

2️⃣ Microservices (service-order, service-user, etc.)
Each microservice:

  • Defines HTTP routes
  • Uses the shared API Gateway
  • Does not deploy the API stage
plugins:
  - serverless-disable-apigateway-deployment

provider:
  apiGateway:
    restApiId: ${cf:api-core-SharedApiId}
    restApiRootResourceId: ${cf:api-core-RootResourceId}

functions:
  getOrders:
    handler: handler.getOrders
    events:
      - http:
          path: orders
          method: get

You can deploy microservices freely — the API Gateway stage will NOT be updated.

3️⃣ api-deployer (ONLY place deployments happen)
This service is responsible for making API changes live.

resources:
  Resources:
    ApiGatewayDeployment:
      Type: AWS::ApiGateway::Deployment
      Properties:
        RestApiId: ${cf:api-core-SharedApiId}
        StageName: prod

Run this service only when you want API changes to go live.

⚠️ Important Notes

  • Your API Gateway must already have at least one deployment.
  • Do NOT use this plugin in your API deployer service.
  • Works with REST APIs only (not HTTP API v2).

Additional Note:

This plugin also prevents the "No Integration Method Found" error" in API Gateway, which can occur when:

  • Deploying multiple microservices in parallel for the first time in an AWS account
  • Using a shared API Gateway across services

Without this plugin, Serverless automatically creates AWS::ApiGateway::Deployment resources for each service, which can cause:

  • API stage conflicts
  • Missing integration methods

By removing automatic deployments:

  • API Gateway resources and methods are created safely
  • Stage updates only happen when you deploy the dedicated API deployer service
  • You can deploy multiple services in parallel without breaking your API Gateway configuration

🧪 Compatibility

  • Serverless Framework v2 & v3
  • AWS API Gateway REST
  • Node.js 14+