serverless-import-apigateway
Dynamically import an existing AWS API Gateway into your Serverless stack.
Purpose
This plugin should no longer be used and is no longer necessary. See Serverless for an example of sharing a single API Gateway between multiple stacks.
https://github.com/MikeSouza/serverless-import-apigateway#readme . All credits go to him
This is a fork ofInstall
npm install serverless-import-apigateway-hook --save-dev
Configuration
Add the plugin to your serverless.yml
:
plugins:
- serverless-import-apigateway-hook
Add the custom configuration:
custom:
importApiGateway:
name: ${self:provider.stage}-existing-service # Required
path: / # Optional
resources: # Optional
- /existing
- /existing/resource
Property | Required | Type | Default | Description |
---|---|---|---|---|
name |
true |
string |
The name of the REST API for the AWS API Gateway to import | |
path |
false |
string |
/ |
The root resource path to import from the REST API |
resources |
false |
array |
[] |
The existing resource paths to import from the REST API |
hook |
false |
string |
publish |
The serverless hook the API Injection will be done |
Usage
Configuration of your serverless.yml
is all you need.
There are no custom commands, just run: sls deploy