Giter Site home page Giter Site logo

serverless-projects / serverless-localstack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from temyers/serverless-localstack

0.0 2.0 0.0 30 KB

Serverless Plugin for running against Localstack.

JavaScript 100.00%
serverless-framework serverless-plugin

serverless-localstack's Introduction

serverless-localstack

Serverless Plugin to support running against Localstack.

This plugin allows any requests to AWS to be redirected to a running Localstack instance.

WARNING: This plugin is very much WIP

Pre-requisites:

  • Localstack

Installation

The easiest way to get started is to install via npm.

npm install -g serverless
npm install -g serverless-localstack

Installation (without npm)

In order for the plugin to be recognized it must first be enabled via the .serverless_plugins directory.

cd project-path/
npm install --save bluebird
npm install --save aws-sdk
mkdir .serverless_plugins
ln -s /<PATH TO THE PLUGIN DIRECTORY>/src/index.js .serverless_plugins/serverless-plugin-localstack

Configuring

There are two ways to configure the plugin, via a JSON file or via serverless.yml. There are two supported methods for configuring the endpoints, globally via the "host" property, or individually. These properties may be mixed, allowing for global override support while also override specific endpoints.

A "host" or individual endpoints must be configured or this plugin will be deactivated.

Configuring endpoints via serverless.yml

service: myService

plugins:
  - serverless-plugin-localstack

custom:
  localstack:
    host: http://localhost
    endpoints:
      S3: http://localhost:4572
      DynamoDB: http://localhost:4570
      CloudFormation: http://localhost:4581
      Elasticsearch: http://localhost:4571
      ES: http://localhost:4578
      SNS: http://localhost:4575
      SQS: http://localhost:4576
      Lambda: http://localhost:4574
      Kinesis: http://localhost:4568

Configuring endpoints via JSON

service: myService

plugins:
  - serverless-plugin-localstack

custom:
  localstack:
    endpointFile: path/to/file.json

Localstack

For full documentation, see https://bitbucket.org/atlassian/localstack

example to go through serverless-plugin-localstack

cd example/service

# start localstack service
docker-compose up -d

# serverless deploy
npm install
sls deploy

Optional Debug Flag

An optional debug flag is supported via serverless.yml that will enable additional debug logs.

custom:
  localstack:
    debug: true

serverless-localstack's People

Contributors

justinm avatar kination avatar ozbillwang avatar

Watchers

 avatar  avatar

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.