Serverless Plugin Decouple

homepage icon https://github.com/mutual-of-enumclaw/serverless-plugin-decouple
Follow @mutual-of-enumclaw

Tracked

NPM Downloads Last Month
407
Issues
0
Stars
0
Forks
0
Watchers
0
Watch Star Fork Issue Download License NPM Build Status Coverage Status Contributors

Repo README Contents:

serverless-plugin-decouple

Allows serverless stacks which import values to leverage the values of the exports rather than the reference to the exports.

Use case

You have a serverless framework deployment which contains your databases. In the process of refactoring you realize that you want to have a caching layer before your database. Currently you’d have to either make a new export or undeploy your dependant stacks.

Implementing

Install the plugin into the directory your serverless.yml is located

npm install serverless-plugin-decouple

Add the decouple plugin to your plugins, and add a custom variable to turn it on

plugins:
    - serverless-plugin-decouple

custom:
    decouple: ${opt:decouple, 'false'}

Run the deploy command

serverless deploy --decouple true