serverless-plugin-env-stage-config 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
# serverless-plugin-env-stage-config
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/serverless-plugin-env-stage-config)
|
|
4
|
+
[](https://github.com/xojs/xo)
|
|
5
|
+
|
|
3
6
|
This [Serverless](http://www.serverless.com/) plugin allows to define environment variable configuration files for stages.
|
|
4
7
|
It exposes a new variable resolver (`$esc`) that automatically picks the correct value based on the selected stage.
|
|
5
8
|
For development stages (`local`, `dev`, `development`), the variables will default to the system’s environment variables.
|
|
6
9
|
|
|
10
|
+
## CI
|
|
11
|
+
|
|
12
|
+
[](https://github.com/bizon/serverless-plugin-env-stage-config/actions/workflows/tests.yml)
|
|
13
|
+
[](https://github.com/bizon/serverless-plugin-env-stage-config/actions/workflows/release.yml)
|
|
14
|
+
|
|
7
15
|
## Installation
|
|
8
16
|
|
|
9
17
|
```sh
|
|
@@ -52,10 +60,10 @@ functions:
|
|
|
52
60
|
|
|
53
61
|
In a local environment, the variables resolved with the `esc:` prefix will be equivalent to using `env:`. Using `useDotenv: true` alongside a `.env` file will alow you to define your environement variables.
|
|
54
62
|
|
|
55
|
-
The
|
|
56
|
-
- local
|
|
57
|
-
- dev
|
|
58
|
-
- development
|
|
63
|
+
The supported local stages are:
|
|
64
|
+
- `local`
|
|
65
|
+
- `dev`
|
|
66
|
+
- `development`
|
|
59
67
|
|
|
60
68
|
## Other stages
|
|
61
69
|
|
|
@@ -64,9 +72,9 @@ If you need to define a different source for the environement variables for your
|
|
|
64
72
|
For example, if you’re using AWS SSM Parameter Store, you could create the following file:
|
|
65
73
|
|
|
66
74
|
```yaml
|
|
67
|
-
MYSQL_HOST: ${ssm:/my-service/prod/MYSQL_HOST
|
|
75
|
+
MYSQL_HOST: ${ssm:/my-service/prod/MYSQL_HOST}
|
|
68
76
|
QUEUE_URL: !Ref MyQueue
|
|
69
|
-
SECRET_TOKEN: ${ssm:/my-service/prod/SECRET_TOKEN
|
|
77
|
+
SECRET_TOKEN: ${ssm:/my-service/prod/SECRET_TOKEN}
|
|
70
78
|
```
|
|
71
79
|
|
|
72
80
|
Any variable that is not included in the `serverless.env.prod.yml` file will produce a warning and fallback to using `env:`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "serverless-plugin-env-stage-config",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"author": "Bertrand Marron <bertrand.marron@gmail.com>",
|
|
5
5
|
"description": "Serverless plugin to define environment variables files for stages",
|
|
6
6
|
"main": "index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@bizon/semantic-release-config": "^1.0.1",
|
|
28
28
|
"semantic-release": "^19.0.2",
|
|
29
|
-
"xo": "^0.
|
|
29
|
+
"xo": "^0.50.0"
|
|
30
30
|
},
|
|
31
31
|
"xo": {
|
|
32
32
|
"semicolon": false,
|