All Projects → theBenForce → serverless-swagger-api

theBenForce / serverless-swagger-api

Licence: other
Simplifies the process of generating an API Gateway API from a swagger file.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to serverless-swagger-api

a-crash-course-on-serverless-with-nodejs
A quick and easy guide of how to hook up a single Serverless service.
Stars: ✭ 28 (+86.67%)
Mutual labels:  serverless-framework, aws-api-gateway
desktop
A native GUI application that makes it easy to explore and test Serverless Framework applications built on AWS Lambda.
Stars: ✭ 42 (+180%)
Mutual labels:  serverless-framework, aws-api-gateway
express-sls-app
How to deploy a Node.js application to AWS Lambda using Serverless, a quick start.
Stars: ✭ 20 (+33.33%)
Mutual labels:  serverless-framework, aws-api-gateway
hyper-kube-config
H Y P E R K U B E - A Serverless API and kubectl plugin providing a storage and retrieval Kubernetes cluster credentials. Hyperkube leverages AWS Secrets Manager for storing credential information.
Stars: ✭ 27 (+80%)
Mutual labels:  aws-apigateway, serverless-framework
Serverless Sam
Serverless framework plugin to export AWS SAM templates for a service
Stars: ✭ 143 (+853.33%)
Mutual labels:  aws-apigateway, serverless-framework
Chalice
Python Serverless Microframework for AWS
Stars: ✭ 8,513 (+56653.33%)
Mutual labels:  aws-apigateway, serverless-framework
aws-serverless-swift-api-template
A Serverless REST API template, implemented in Swift with swift-aws-lambda-runtime.
Stars: ✭ 42 (+180%)
Mutual labels:  aws-apigateway, serverless-framework
Aws Lambda Typescript
This sample uses the Serverless Application Framework to implement an AWS Lambda function in TypeScript, deploy it via CloudFormation, publish it through API Gateway to a custom domain registered on Route53, and document it with Swagger.
Stars: ✭ 228 (+1420%)
Mutual labels:  aws-apigateway, serverless-framework
aws-secure-websockets
Secure web socket implementation using AWS products and serverless framework
Stars: ✭ 49 (+226.67%)
Mutual labels:  aws-apigateway, serverless-framework
amazon-ivs-ugc-web-demo
This repository shows how you can build a compelling user-generated content (UGC) live streaming webapp with Amazon IVS.
Stars: ✭ 14 (-6.67%)
Mutual labels:  serverless-framework
aws-serverless-prototype
Serverless Frameworkを使ったAWS Lambdaプロジェクトの試作品
Stars: ✭ 16 (+6.67%)
Mutual labels:  serverless-framework
ecommerce-shopfront-on-aws
A high availability, API-first reference architecture for ecommerce using AWS services
Stars: ✭ 56 (+273.33%)
Mutual labels:  aws-api-gateway
noiiice
a serverless blog built on NuxtJS, AWS, serverless framework, and irrational exuberance.
Stars: ✭ 42 (+180%)
Mutual labels:  serverless-framework
serverless-plugin-offline-kinesis-events
⚡ Serverless plugin that works with serverless-offline to allow offline testing of Serverless functions that are triggered by Kinesis events.
Stars: ✭ 15 (+0%)
Mutual labels:  serverless-framework
pexels-demo
A Node JS Express/Serverless demo application that creates a personalised video using a form. Uses the Pexels Video library and Shotstack video editing API.
Stars: ✭ 22 (+46.67%)
Mutual labels:  serverless-framework
serverless-modular
⚡️ serverless plugin for microservice code management and deployment.
Stars: ✭ 19 (+26.67%)
Mutual labels:  serverless-framework
sls-photos-upload-service
Example web app and serverless API for uploading photos and saving to S3 and DynamoDB
Stars: ✭ 50 (+233.33%)
Mutual labels:  serverless-framework
ginger
Serverless framework for Go runtime.
Stars: ✭ 16 (+6.67%)
Mutual labels:  aws-apigateway
serverless-aws-rust-multi
⚡🏗️ template for new aws lambda serverless rust http apps
Stars: ✭ 51 (+240%)
Mutual labels:  serverless-framework
fastapi-mangum-example
Deploy FastAPI as Lambda using serverless and mangum
Stars: ✭ 21 (+40%)
Mutual labels:  serverless-framework

Serverless Swagger API

Build Status Maintainability npm version FOSSA Status

This is a serverless plugin that simplifies the process of creating an AWS API Gateway from a swagger file.

Installation

yarn add --dev serverless-swagger-api

Configuration

Lambda Functions

You must manually create your own lambda functions in the serverless configuration. Once the methods are created, they will be referenced in the swagger file.

Swagger File

Add a x-lambda-name property to every path method to bind a part of the api to a lambda. Values specified for x-lambda-name is AWS CloudFormation resource names, i.e., values in the form of {normalizedFunctionName}LambdaFunction. For more information about naming rules, please refer to the description in the Serverless Framework documentation.

paths:
  /testPath:
    get:
      x-lambda-name: TestPathLambdaFunction
      ...

CORS Configuration

Add a x-cors property to the path you want to add CORS options responses to.

paths:
  /testPath:
    x-cors: true

If you want to specify a specific attribute, provide one of the following properties

Property Description Default
origin A string specifying allowed origins *
headers An array of headers to be allowed Constructed from the parameters property of every path method
methods An array of methods to be allowed Constructed by looking at all methods defined for a path

Plugin Settings

Now you need to tell the swagger api plugin about your configuration file. Add a swaggerApi property to the custom section of your serverless configuration. You can add as many apis as you want by adding children to the swaggerApi.apis property.

updateDeployments

Will automatically update API gateway deployments if not set to false.

usePackageVersion

The info.version value in your OpenAPI file will be overwritten with the version in package.json.

apis

An object containing all of the APIs to be defined in this stack.

custom:
  swaggerApi:
    updateDeployments: true
    usePackageVersion: true
    apis:
      PrimaryApi:
        Name: ${self:provider.stage}-${self:service}-PrimaryApi
        Body: ${file(./some-swagger-file.yaml)}
        Lambda: ExampleLambdaFunction
        Stage: dev
Properties

Each API object has the following properties

Name Required Description
Name Yes Name of the API that will be used as the Name parameter when creating the AWS::ApiGateway::RestApi CloudFormation object
Body Yes The swagger/openapi file that defines the API
Stage Yes The name of the API Gateway stage that will be created
Lambda No Default lambda name that will be used if x-lambda-name isn't provided on a path (see the description of x-lambda-name for the value to be specified as the name)

Created Resources

IAM Roles

An IAM role is created for each API with the name PrimaryApiServiceRole

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].