serverless-plugin-warmup 7.2.0 → 7.3.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/README.md +2 -0
- package/package.json +3 -3
- package/src/config.js +3 -0
- package/src/schema.js +1 -0
- package/src/warmer.js +1 -0
package/README.md
CHANGED
|
@@ -68,6 +68,7 @@ The options are the same for all the warmers:
|
|
|
68
68
|
* **vpc** The VPC and subnets in which to deploy. Can be any [Serverless VPC configuration](https://serverless.com/framework/docs/providers/aws/guide/functions#vpc-configuration) or be set to `false` in order to deploy the warmup function outside of a VPC (defaults to the vpc in the provider)
|
|
69
69
|
* **memorySize** The memory to be assigned to the warmer lambda (defaults to `128`)
|
|
70
70
|
* **events** The event that triggers the warmer lambda. Can be any [Serverless event](https://serverless.com/framework/docs/providers/aws/events/) (defaults to `- schedule: rate(5 minutes)`)
|
|
71
|
+
* **architecture** The [instruction set to use for the lambda](https://www.serverless.com/framework/docs/providers/aws/guide/functions#instruction-set-architecture) (defaults to `arm64`)
|
|
71
72
|
* **package** The package configuration. Can be any [Serverless package configuration](https://serverless.com/framework/docs/providers/aws/guide/packaging#package-configuration) (defaults to `{ individually: true, patterns: ['!**', '.warmup/${warmerName}/**'] }`)
|
|
72
73
|
* **timeout** How many seconds until the warmer lambda times out. (defaults to `10`)
|
|
73
74
|
* **environment** Can be used to set environment variables in the warmer lambda. You can also unset variables configured at the provider by setting them to undefined. However, you should almost never have to change the default. (defaults to unset all package level environment variables. )
|
|
@@ -267,6 +268,7 @@ custom:
|
|
|
267
268
|
default:
|
|
268
269
|
enabled: true
|
|
269
270
|
role: IamRoleLambdaExecution
|
|
271
|
+
architecture: 'arm64'
|
|
270
272
|
```
|
|
271
273
|
|
|
272
274
|
If setting `prewarm` to `true`, the deployment user used by the AWS CLI and the Serverless framework also needs permissions to invoke the warmer.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "serverless-plugin-warmup",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Keep your lambdas warm during winter.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"eslint": "^8.5.0",
|
|
35
35
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
36
36
|
"eslint-plugin-import": "^2.24.2",
|
|
37
|
-
"husky": "^
|
|
38
|
-
"jest": "^
|
|
37
|
+
"husky": "^8.0.1",
|
|
38
|
+
"jest": "^28.1.3"
|
|
39
39
|
}
|
|
40
40
|
}
|
package/src/config.js
CHANGED
|
@@ -20,6 +20,9 @@ function getWarmerConfig(config, defaultOpts) {
|
|
|
20
20
|
vpc: config.vpc === false ? { securityGroupIds: [], subnetIds: [] }
|
|
21
21
|
: (config.vpc !== undefined ? config.vpc : defaultOpts.vpc),
|
|
22
22
|
events: (Array.isArray(config.events)) ? config.events : defaultOpts.events,
|
|
23
|
+
architecture: (config.architecture !== undefined)
|
|
24
|
+
? config.architecture
|
|
25
|
+
: defaultOpts.architecture,
|
|
23
26
|
package: typeof config.package === 'object'
|
|
24
27
|
? {
|
|
25
28
|
individually: (config.package.individually !== undefined)
|
package/src/schema.js
CHANGED
package/src/warmer.js
CHANGED
|
@@ -222,6 +222,7 @@ function addWarmUpFunctionToService(service, warmerName, warmerConfig) {
|
|
|
222
222
|
handler: warmerConfig.pathHandler.split(path.sep).join(path.posix.sep),
|
|
223
223
|
memorySize: warmerConfig.memorySize,
|
|
224
224
|
name: warmerConfig.name,
|
|
225
|
+
...(warmerConfig.architecture ? { architecture: warmerConfig.architecture } : {}),
|
|
225
226
|
runtime: 'nodejs16.x',
|
|
226
227
|
package: warmerConfig.package,
|
|
227
228
|
timeout: warmerConfig.timeout,
|