0.0.31 • Published 2 years ago

serverless-cfg-service-plugin v0.0.31

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

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago