serverless-plugin-warmup 8.1.0 → 8.2.1

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 CHANGED
@@ -258,7 +258,7 @@ The permissions can also be added to all lambdas using setting the role to `IamR
258
258
  ```yaml
259
259
  provider:
260
260
  name: aws
261
- runtime: nodejs16.x
261
+ runtime: nodejs18.x
262
262
  iamRoleStatements:
263
263
  - Effect: 'Allow'
264
264
  Action:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "serverless-plugin-warmup",
3
- "version": "8.1.0",
3
+ "version": "8.2.1",
4
4
  "description": "Keep your lambdas warm during winter.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/warmer.js CHANGED
@@ -132,14 +132,11 @@ async function createWarmUpFunctionArtifact(functions, tracing, verbose, region,
132
132
 
133
133
  ${tracing
134
134
  ? `const AWSXRay = require('aws-xray-sdk-core');
135
- const AWS = AWSXRay.captureAWS(require('aws-sdk'));`
136
- : 'const AWS = require(\'aws-sdk\')'};
135
+ const AWS = AWSXRay.captureAWS(require('@aws-sdk/client-lambda'));`
136
+ : 'const AWS = require(\'@aws-sdk/client-lambda\')'};
137
137
  const lambda = new AWS.Lambda({
138
138
  apiVersion: '2015-03-31',
139
- region: '${region}',
140
- httpOptions: {
141
- connectTimeout: 1000, // 1 second
142
- },
139
+ region: '${region}'
143
140
  });
144
141
  const functions = ${JSON.stringify(functions, null, ' ')};
145
142
 
@@ -189,7 +186,7 @@ module.exports.warmUp = async (event, context) => {
189
186
  };
190
187
 
191
188
  try {
192
- await Promise.all(Array(concurrency).fill(0).map(async () => await lambda.invoke(params).promise()));
189
+ await Promise.all(Array(concurrency).fill(0).map(async () => await lambda.invoke(params)));
193
190
  logVerbose(\`Warm Up Invoke Success: \${func.name}\`);
194
191
  return true;
195
192
  } catch (e) {
@@ -223,7 +220,7 @@ function addWarmUpFunctionToService(service, warmerName, warmerConfig) {
223
220
  memorySize: warmerConfig.memorySize,
224
221
  name: warmerConfig.name,
225
222
  ...(warmerConfig.architecture ? { architecture: warmerConfig.architecture } : {}),
226
- runtime: 'nodejs16.x',
223
+ runtime: 'nodejs18.x',
227
224
  package: warmerConfig.package,
228
225
  timeout: warmerConfig.timeout,
229
226
  ...(Object.keys(warmerConfig.environment).length