0.0.31 • Published 3 years ago

serverless-cfg-service-plugin v0.0.31

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
3 years ago

Serverless Config Service Plugin

The Serverless Config Service Plugin is a NPM package used within C1. This Serverless plugin allows you to retrieve values and populate those values as environment variables from config service/redis commander within a serverless.yaml file.

Installation

First install the plugin using npm

npm install maskdata --save-dev
npm install redis --save-dev
npm install serverless-cfg-service-plugin --save-dev

Then inside your project's serverless.yml file add the following to the plugins section. You should change the redis url & port to match your build environment.

provider:
  environment:
    CONFIG_SERVICE_REDIS_URL: updateme
    CONFIG_SERVICE_REDIS_PORT: updateme
    CONFIG_SERVICE_JSON_KEY: ${self:custom.rootServiceName}/application-dev.json/<updateme>
    CONFIG_SERVICE_PROPERTIES_KEY: ${self:custom.rootServiceName}/application-dev.properties/<updateme>
plugins:
  - serverless-cfg-service-plugin

To reference a config service value, you must prefix it with ${cfg(param1, param2, param3):redisKey}, and pass 3 params to this custom variable for retrieving values from config service, the params' order should be rootServiceName, redisUrl, redisPort. For example:

provider:
  environment:
    SOME_VARIABLE: ${cfg:${self:provider.environment.CONFIG_SERVICE_PROPERTIES_KEY}}

custom:
  rootServiceName: 'updateme'
0.0.31

3 years ago

0.0.30

3 years ago

0.0.29

3 years ago

0.0.28

3 years ago

0.0.27

3 years ago

0.0.26

3 years ago

0.0.25

3 years ago

0.0.24

3 years ago

0.0.23

3 years ago

0.0.22

3 years ago

0.0.21

3 years ago

0.0.20

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago