GithubHelp home page GithubHelp logo

alexdebrie / serverless-endpoint-configuration Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 1.0 2 KB

A Serverless plugin to set API Gateway endpoint configuration for your Serverless services

JavaScript 100.00%

serverless-endpoint-configuration's Introduction

serverless-endpoint-configuration

A Serverless plugin to set API Gateway endpoint configuration for your Serverless services.

AWS recently announced regional API endpoints for API Gateway. However, this configuration is not yet supported in CloudFormation. This plugin lets you programmatically set your endpoints with a single command ๐ŸŽ‰.

Usage

  1. Install the plugin in your Serverless service:
$ npm install --save-dev serverless-endpoint-configuration
  1. Add configuration to your serverless.yml:
plugins:
    - serverless-endpoint-configuration

custom:
    endpoint:
      type: 'REGIONAL'
      updateOnDeploy: true # Default is true
  1. Run sls deploy to deploy your application with your configured endpoint!

Configuration

By default, it will update the endpoint configuration after a deploy. If you prefer more granular control, you can set updateOnDeploy: false in your serverless.yml:

custom:
  endpoint:
    type: 'REGIONAL'
    updateOnDeploy: false

Then you can run sls endpoints set to manually update your endpoint configuration.

Limitations

  • Updating configuration can take a few minutes. If you try to change back and forth too quickly, it will throw an error.
  • I'd like to add a get command to check current config, but the getRestApi method from the SDK is not returning endpointConfiguration as noted in the docs.
  • This plugin will probably become irrelevant when AWS adds endpoint configuration support to CloudFormation. Enjoy it while it lasts!

serverless-endpoint-configuration's People

Contributors

alexdebrie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

josephites

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.