serverless-offline-conditional-resources
v0.0.3
Published
Deploy serverless resources conditionally
Downloads
424
Maintainers
Readme
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
- production
layers:
...
my-layer:
stages:
- dev
- production
resources:
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.