serverless-vpc-discovery 3.1.0 → 4.0.0
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/CHANGELOG.md +12 -0
- package/README.md +7 -5
- package/dist/src/index.js +3 -0
- package/dist/src/schema.js +63 -0
- package/package-lock.json +729 -3016
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [4.0.0] - 2022-04-08
|
8
|
+
### Changed
|
9
|
+
- Added compability with serverless 3
|
10
|
+
|
11
|
+
## [3.1.2] - 2021-09-01
|
12
|
+
### Changed
|
13
|
+
- Fixed y18n vulnerability
|
14
|
+
|
15
|
+
## [3.1.1] - 2021-09-01
|
16
|
+
### Changed
|
17
|
+
- Added serverless schema validation. Thank you @ROSeaboyer ([53](https://github.com/amplify-education/serverless-vpc-discovery/pull/53))
|
18
|
+
|
7
19
|
## [3.1.0] - 2021-09-01
|
8
20
|
### Changed
|
9
21
|
- Dropped support of node versions < 12
|
package/README.md
CHANGED
@@ -157,18 +157,20 @@ npm test
|
|
157
157
|
```
|
158
158
|
All tests should pass.
|
159
159
|
|
160
|
-
If there is an error update the node_module inside the serverless-vpc-discovery folder:
|
161
|
-
```
|
162
|
-
npm install
|
163
|
-
```
|
164
|
-
|
165
160
|
To run integration tests, set an environment variable TEST_VPC_NAME to the VPC you will be testing for. Then,
|
166
161
|
```
|
167
162
|
export AWS_PROFILE=your_profile
|
168
163
|
export TEST_VPC_NAME=vpc_name
|
164
|
+
npm build
|
169
165
|
npm run integration-test
|
170
166
|
```
|
171
167
|
|
168
|
+
If there is an error build and install the node_module inside the serverless-vpc-discovery folder:
|
169
|
+
```
|
170
|
+
npm build
|
171
|
+
npm install .
|
172
|
+
```
|
173
|
+
|
172
174
|
## Deploying with the plugin
|
173
175
|
When deploying run:
|
174
176
|
```
|
package/dist/src/index.js
CHANGED
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
14
|
const lambda_function_1 = require("./common/lambda-function");
|
15
15
|
const globals_1 = __importDefault(require("./globals"));
|
16
16
|
const validation_1 = require("./validation");
|
17
|
+
const schema_1 = require("./schema");
|
17
18
|
class VPCPlugin {
|
18
19
|
constructor(serverless) {
|
19
20
|
this.serverless = serverless;
|
@@ -22,6 +23,8 @@ class VPCPlugin {
|
|
22
23
|
this.hooks = {
|
23
24
|
"before:package:initialize": this.hookWrapper.bind(this, this.updateFunctionsVpcConfig)
|
24
25
|
};
|
26
|
+
serverless.configSchemaHandler.defineCustomProperties(schema_1.customProperties);
|
27
|
+
serverless.configSchemaHandler.defineFunctionProperties("aws", schema_1.functionProperties);
|
25
28
|
}
|
26
29
|
/**
|
27
30
|
* Wrapper for lifecycle function, initializes variables and checks if enabled.
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.customProperties = exports.functionProperties = void 0;
|
4
|
+
const baseProperties = {
|
5
|
+
type: "object",
|
6
|
+
properties: {
|
7
|
+
vpcName: { type: "string" },
|
8
|
+
subnets: {
|
9
|
+
type: "array",
|
10
|
+
items: {
|
11
|
+
type: "object",
|
12
|
+
properties: {
|
13
|
+
names: {
|
14
|
+
type: "array",
|
15
|
+
items: { type: "string" }
|
16
|
+
},
|
17
|
+
tagKey: { type: "string" },
|
18
|
+
tagValues: {
|
19
|
+
type: "array",
|
20
|
+
items: { type: "string" }
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
},
|
25
|
+
securityGroups: {
|
26
|
+
type: "array",
|
27
|
+
items: {
|
28
|
+
type: "object",
|
29
|
+
properties: {
|
30
|
+
tagKey: { type: "string" },
|
31
|
+
tagValues: {
|
32
|
+
type: "array",
|
33
|
+
items: { type: "string" }
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
},
|
38
|
+
// DEPRECATED
|
39
|
+
subnetNames: {
|
40
|
+
type: "array",
|
41
|
+
items: { type: "string" }
|
42
|
+
},
|
43
|
+
securityGroupNames: {
|
44
|
+
type: "array",
|
45
|
+
items: { type: "string" }
|
46
|
+
}
|
47
|
+
}
|
48
|
+
};
|
49
|
+
exports.functionProperties = {
|
50
|
+
properties: {
|
51
|
+
vpcDiscovery: {
|
52
|
+
anyOf: [
|
53
|
+
{ type: "boolean" },
|
54
|
+
baseProperties
|
55
|
+
]
|
56
|
+
}
|
57
|
+
}
|
58
|
+
};
|
59
|
+
exports.customProperties = {
|
60
|
+
properties: {
|
61
|
+
vpcDiscovery: baseProperties
|
62
|
+
}
|
63
|
+
};
|