Skip to content

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

Notifications You must be signed in to change notification settings

alexdebrie/serverless-endpoint-configuration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

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!

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published