0.0.31 • Published 9 months ago

serverless-cfg-service-plugin v0.0.31

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
9 months 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

9 months ago

0.0.30

9 months ago

0.0.29

9 months ago

0.0.28

9 months ago

0.0.27

9 months ago

0.0.26

9 months ago

0.0.25

9 months ago

0.0.24

9 months ago

0.0.23

9 months ago

0.0.22

9 months ago

0.0.21

10 months ago

0.0.20

10 months ago

0.0.18

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago