Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Latest commit

 

History

History
28 lines (22 loc) · 821 Bytes

README.md

File metadata and controls

28 lines (22 loc) · 821 Bytes

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