serverless-offline-conditional-resources
About
serverless-offline-conditional-resources
is a lightweight plugin to conditionally remove
functions
, resources
and stackTags
from deployments based on current stage
. This
can be very helpful when working with unsupported by Localstack resource types.
Installation
Use yarn
or npm
to add the plugin to your package dependecies:
npm install --save-dev serverless-offline-conditional-resources
or
yarn add serverless-offline-conditional-resources --dev
Usage
- Add plugin to you serverless plugins
plugins: ... - serverless-offline-conditional-resources
- Configure plugin
By default resources are not excluded upon deployment. To start excluding them,
you need to provide stages
or Stages
attribute to whitelist allowed stages.
provider: stackTags: stages: - dev - prod - staging MY_TAG: tag-one vpc: stages: - dev - prod - staging ...functions: ... my-function: stages: - dev - productionlayers: ... my-layer: stages: - dev - productionresources: Outputs: MyCoolOutput: Stages: - dev Ref: some-ref Resources: MyLovelyResource: Stages: - prod Type: Aws::AwesomeResource ...
Contributions
You are welcome to create pull requests to improve the project. Please check out the contribution quick guide to get started.
License
The project is distributed under MIT license.