serverless-nested-yml
A serverless plugin to merge nested servless.yml files
Last updated 4 months ago by goopil .
MIT · Original npm · Tarball · package.json
$ cnpm install serverless-nested-yml 
SYNC missed versions from official npm registry.

NPM serverless js-standard-style MIT licensed

Serverless Nested Yml

This plugin help to tiddy your project by splitting your yaml file by sub directory. It then merge all the globed files in to one configuration.

Install

This plugin only works for Serverless 1.0 and up. And require node >= 8 to work properly

npm install serverless-nested-yml --save-dev

Next, add the serverless-nested-yml plugin in to serverless.yml file: If you don't already have a plugins section, create one that looks like this:

plugins:
  - serverless-nested-yml

To verify that the plugin was added successfully, run this in your command line:

serverless The plugin should show up in the "Plugins" section of the output as "ServerlessNestedYml"

Usage

In your main serverless.yml file you should define the common properties used by all your functions.

configure

custom:
  nestedYml:
    filename: // Filename to search | optional, string - default *serverless.yml
    paths:    // Path to search | optional, string | array - default ['src']
    exclude:  // Path to exclude from search | optional, string | array - default []
    monorepo:  // add global path to each handler and force root webpack config file | optional, boolean - default false

project structure

<root>
- serverless.yml
- src
    - service1
      - handler.js
      - serverless.yml
    - service2
      - handler.js
      - serverless.yml

main serverless.yml


service: myService

plugins:
  - serverless-nested-yml
  
provider:
  name: aws
  runtime: nodejs8.10
  stage: staging
  region: eu-west-1

service 1 serverless.yml

! headup ! The handler path is always based on the root project.

functions:
  myFunction:
    handler: src/service1/handler.handler
    events:
      - http:
          method: get
          path: /

Contribute

Help us making this plugin better and future proof.

  • Clone the code
  • Install the dependencies with npm install
  • Create a feature branch git checkout -b new_feature
  • Lint with standard npm run lint

License

This software is released under the MIT license. See the license file for more details.

Current Tags

  • 1.0.7                                ...           latest (4 months ago)

8 Versions

  • 1.0.7                                ...           4 months ago
  • 1.0.6                                ...           6 months ago
  • 1.0.5                                ...           6 months ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 8
Last Month 0
Dependencies (1)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |