serverless-plugin-warmup 8.3.0 → 8.4.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/src/schema.js CHANGED
@@ -2,176 +2,191 @@
2
2
  * @description Define the additions to the serverless schema by this plugin.
3
3
  * */
4
4
  function extendServerlessSchema(serverless) {
5
- // Most of these are taken from
6
- // https://github.com/serverless/serverless/blob/master/lib/configSchema.js
7
- // https://github.com/serverless/serverless/blob/master/lib/plugins/aws/provider.js
8
- // https://github.com/serverless/serverless/blob/master/lib/plugins/aws/package/compile/events/schedule.js
5
+ // Most of these are taken from
6
+ // https://github.com/serverless/serverless/blob/master/lib/configSchema.js
7
+ // https://github.com/serverless/serverless/blob/master/lib/plugins/aws/provider.js
8
+ // https://github.com/serverless/serverless/blob/master/lib/plugins/aws/package/compile/events/schedule.js
9
9
 
10
- const rateSyntax = '^rate\\((?:1 (?:minute|hour|day)|(?:1\\d+|[2-9]\\d*) (?:minute|hour|day)s)\\)$';
11
- const cronSyntax = '^cron\\(\\S+ \\S+ \\S+ \\S+ \\S+ \\S+\\)$';
12
- const scheduleSyntax = `${rateSyntax}|${cronSyntax}`;
10
+ const rateSyntax =
11
+ '^rate\\((?:1 (?:minute|hour|day)|(?:1\\d+|[2-9]\\d*) (?:minute|hour|day)s)\\)$';
12
+ const cronSyntax = '^cron\\(\\S+ \\S+ \\S+ \\S+ \\S+ \\S+\\)$';
13
+ const scheduleSyntax = `${rateSyntax}|${cronSyntax}`;
13
14
 
14
- const globalConfigSchemaProperties = {
15
- folderName: { type: 'string' },
16
- cleanFolder: { type: 'boolean' },
17
- name: { type: 'string' },
18
- roleName: { type: 'string' },
19
- role: { $ref: '#/definitions/awsLambdaRole' },
20
- tags: { $ref: '#/definitions/awsResourceTags' },
21
- vpc: {
22
- anyOf: [
23
- { const: false }, // to deploy outside of the VPC
24
- { $ref: '#/definitions/awsLambdaVpcConfig' },
25
- ],
26
- },
27
- events: {
28
- type: 'array',
29
- items: {
30
- type: 'object',
31
- properties: {
32
- schedule: {
33
- anyOf: [
34
- { type: 'string', pattern: scheduleSyntax },
35
- {
36
- type: 'object',
37
- properties: {
38
- rate: {
39
- type: 'array',
40
- minItems: 1,
41
- items: {
42
- type: 'string',
43
- pattern: scheduleSyntax,
44
- },
45
- },
46
- enabled: { type: 'boolean' },
47
- name: {
48
- type: 'string', minLength: 1, maxLength: 64, pattern: '[\\.\\-_A-Za-z0-9]+',
49
- },
50
- description: { type: 'string', maxLength: 512 },
51
- input: {
52
- anyOf: [
53
- { type: 'string', maxLength: 8192 },
54
- {
55
- type: 'object',
56
- oneOf: [
57
- {
58
- properties: {
59
- body: { type: 'string', maxLength: 8192 },
60
- },
61
- required: ['body'],
62
- additionalProperties: false,
63
- },
64
- {
65
- not: {
66
- required: ['body'],
67
- },
68
- },
69
- ],
70
- },
71
- ],
72
- },
73
- inputPath: { type: 'string', maxLength: 256 },
74
- inputTransformer: {
75
- type: 'object',
76
- properties: {
77
- inputTemplate: {
78
- type: 'string',
79
- minLength: 1,
80
- maxLength: 8192,
81
- },
82
- inputPathsMap: { type: 'object' },
83
- },
84
- required: ['inputTemplate'],
85
- additionalProperties: false,
86
- },
87
- },
88
- required: ['rate'],
89
- additionalProperties: false,
90
- },
91
- ],
92
- },
93
- },
94
- required: ['schedule'],
95
- additionalProperties: false,
96
- },
97
- },
98
- architecture: { enum: ['arm64', 'x86_64'] },
99
- package: {
100
- type: 'object',
101
- properties: {
102
- artifact: { type: 'string' },
103
- patterns: { type: 'array', items: { type: 'string' } },
104
- individually: { type: 'boolean' },
105
- },
106
- additionalProperties: false,
107
- },
108
- memorySize: { $ref: '#/definitions/awsLambdaMemorySize' },
109
- timeout: { $ref: '#/definitions/awsLambdaTimeout' },
110
- environment: { $ref: '#/definitions/awsLambdaEnvironment' },
111
- tracing: { $ref: '#/definitions/awsLambdaTracing' },
112
- verbose: { type: 'boolean' },
113
- logRetentionInDays: { $ref: '#/definitions/awsLogRetentionInDays' },
114
- prewarm: { type: 'boolean' },
115
- };
15
+ const METHOD_SCHEDULER = 'scheduler';
16
+ const METHOD_EVENT_BUS = 'eventBus';
116
17
 
117
- const functionConfigSchemaProperties = {
118
- enabled: {
119
- anyOf: [
120
- { type: 'boolean' },
121
- { type: 'string' },
122
- { type: 'array', items: { type: 'string' } },
123
- ],
124
- },
125
- alias: { type: 'string' },
126
- clientContext: {
127
- anyOf: [
128
- { const: false }, // to skip it
129
- { type: 'object' }, // any
130
- ],
131
- },
132
- payload: { type: 'object' }, // any
133
- payloadRaw: { type: 'boolean' },
134
- concurrency: { type: 'integer' },
135
- };
18
+ const globalConfigSchemaProperties = {
19
+ folderName: { type: 'string' },
20
+ cleanFolder: { type: 'boolean' },
21
+ name: { type: 'string' },
22
+ roleName: { type: 'string' },
23
+ role: { $ref: '#/definitions/awsLambdaRole' },
24
+ tags: { $ref: '#/definitions/awsResourceTags' },
25
+ vpc: {
26
+ anyOf: [
27
+ { const: false }, // to deploy outside of the VPC
28
+ { $ref: '#/definitions/awsLambdaVpcConfig' },
29
+ ],
30
+ },
31
+ events: {
32
+ type: 'array',
33
+ items: {
34
+ type: 'object',
35
+ properties: {
36
+ schedule: {
37
+ anyOf: [
38
+ { type: 'string', pattern: scheduleSyntax },
39
+ {
40
+ type: 'object',
41
+ properties: {
42
+ rate: {
43
+ type: 'array',
44
+ minItems: 1,
45
+ items: {
46
+ type: 'string',
47
+ pattern: scheduleSyntax,
48
+ },
49
+ },
50
+ enabled: { type: 'boolean' },
51
+ name: {
52
+ type: 'string',
53
+ minLength: 1,
54
+ maxLength: 64,
55
+ pattern: '[\\.\\-_A-Za-z0-9]+',
56
+ },
57
+ description: { type: 'string', maxLength: 512 },
58
+ input: {
59
+ anyOf: [
60
+ { type: 'string', maxLength: 8192 },
61
+ {
62
+ type: 'object',
63
+ oneOf: [
64
+ {
65
+ properties: {
66
+ body: { type: 'string', maxLength: 8192 },
67
+ },
68
+ required: ['body'],
69
+ additionalProperties: false,
70
+ },
71
+ {
72
+ not: {
73
+ required: ['body'],
74
+ },
75
+ },
76
+ ],
77
+ },
78
+ ],
79
+ },
80
+ inputPath: { type: 'string', maxLength: 256 },
81
+ inputTransformer: {
82
+ type: 'object',
83
+ properties: {
84
+ inputTemplate: {
85
+ type: 'string',
86
+ minLength: 1,
87
+ maxLength: 8192,
88
+ },
89
+ inputPathsMap: { type: 'object' },
90
+ },
91
+ required: ['inputTemplate'],
92
+ additionalProperties: false,
93
+ },
94
+ method: {
95
+ type: 'string',
96
+ enum: [METHOD_EVENT_BUS, METHOD_SCHEDULER],
97
+ },
98
+ timezone: {
99
+ type: 'string',
100
+ pattern: '[\\w\\-\\/]+',
101
+ },
102
+ },
103
+ required: ['rate'],
104
+ additionalProperties: false,
105
+ },
106
+ ],
107
+ },
108
+ },
109
+ required: ['schedule'],
110
+ additionalProperties: false,
111
+ },
112
+ },
113
+ architecture: { enum: ['arm64', 'x86_64'] },
114
+ package: {
115
+ type: 'object',
116
+ properties: {
117
+ artifact: { type: 'string' },
118
+ patterns: { type: 'array', items: { type: 'string' } },
119
+ individually: { type: 'boolean' },
120
+ },
121
+ additionalProperties: false,
122
+ },
123
+ memorySize: { $ref: '#/definitions/awsLambdaMemorySize' },
124
+ timeout: { $ref: '#/definitions/awsLambdaTimeout' },
125
+ environment: { $ref: '#/definitions/awsLambdaEnvironment' },
126
+ tracing: { $ref: '#/definitions/awsLambdaTracing' },
127
+ verbose: { type: 'boolean' },
128
+ logRetentionInDays: { $ref: '#/definitions/awsLogRetentionInDays' },
129
+ prewarm: { type: 'boolean' },
130
+ };
136
131
 
137
- if (!serverless.configSchemaHandler) return;
132
+ const functionConfigSchemaProperties = {
133
+ enabled: {
134
+ anyOf: [
135
+ { type: 'boolean' },
136
+ { type: 'string' },
137
+ { type: 'array', items: { type: 'string' } },
138
+ ],
139
+ },
140
+ alias: { type: 'string' },
141
+ clientContext: {
142
+ anyOf: [
143
+ { const: false }, // to skip it
144
+ { type: 'object' }, // any
145
+ ],
146
+ },
147
+ payload: { type: 'object' }, // any
148
+ payloadRaw: { type: 'boolean' },
149
+ concurrency: { type: 'integer' },
150
+ };
138
151
 
139
- if (typeof serverless.configSchemaHandler.defineCustomProperties === 'function') {
140
- serverless.configSchemaHandler.defineCustomProperties({
141
- properties: {
142
- warmup: {
143
- type: 'object',
144
- patternProperties: {
145
- '.*': {
146
- type: 'object',
147
- properties: { ...globalConfigSchemaProperties, ...functionConfigSchemaProperties },
148
- additionalProperties: false,
149
- },
150
- },
151
- },
152
- },
153
- });
154
- }
152
+ if (!serverless.configSchemaHandler) return;
155
153
 
156
- if (typeof serverless.configSchemaHandler.defineFunctionProperties === 'function') {
157
- serverless.configSchemaHandler.defineFunctionProperties('aws', {
158
- type: 'object',
159
- properties: {
160
- warmup: {
161
- type: 'object',
162
- patternProperties: {
163
- '.*': {
164
- type: 'object',
165
- properties: functionConfigSchemaProperties,
166
- additionalProperties: false,
167
- },
168
- },
169
- },
170
- },
171
- });
172
- }
154
+ if (typeof serverless.configSchemaHandler.defineCustomProperties === 'function') {
155
+ serverless.configSchemaHandler.defineCustomProperties({
156
+ properties: {
157
+ warmup: {
158
+ type: 'object',
159
+ patternProperties: {
160
+ '.*': {
161
+ type: 'object',
162
+ properties: { ...globalConfigSchemaProperties, ...functionConfigSchemaProperties },
163
+ additionalProperties: false,
164
+ },
165
+ },
166
+ },
167
+ },
168
+ });
169
+ }
170
+
171
+ if (typeof serverless.configSchemaHandler.defineFunctionProperties === 'function') {
172
+ serverless.configSchemaHandler.defineFunctionProperties('aws', {
173
+ type: 'object',
174
+ properties: {
175
+ warmup: {
176
+ type: 'object',
177
+ patternProperties: {
178
+ '.*': {
179
+ type: 'object',
180
+ properties: functionConfigSchemaProperties,
181
+ additionalProperties: false,
182
+ },
183
+ },
184
+ },
185
+ },
186
+ });
187
+ }
173
188
  }
174
189
 
175
190
  module.exports = {
176
- extendServerlessSchema,
191
+ extendServerlessSchema,
177
192
  };
package/src/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const capitalize = (name) => name.charAt(0).toUpperCase() + name.slice(1);
2
2
 
3
3
  module.exports = {
4
- capitalize,
4
+ capitalize,
5
5
  };
package/src/warmer.js CHANGED
@@ -10,109 +10,92 @@ const execAsync = util.promisify(exec);
10
10
  * @description Add warmer role to service
11
11
  * */
12
12
  function addWarmUpFunctionRoleToResources(service, stage, warmerName, warmerConfig) {
13
- // eslint-disable-next-line no-param-reassign
14
- warmerConfig.role = `WarmUpPlugin${capitalize(warmerName)}Role`;
15
- if (typeof service.resources !== 'object') {
16
- // eslint-disable-next-line no-param-reassign
17
- service.resources = {};
18
- }
19
- if (typeof service.resources.Resources !== 'object') {
20
- // eslint-disable-next-line no-param-reassign
21
- service.resources.Resources = {};
22
- }
23
-
24
- // eslint-disable-next-line no-param-reassign
25
- service.resources.Resources[warmerConfig.role] = {
26
- Type: 'AWS::IAM::Role',
27
- Properties: {
28
- Path: '/',
29
- RoleName: warmerConfig.roleName || {
30
- 'Fn::Join': [
31
- '-',
32
- [
33
- service.service,
34
- stage,
35
- { Ref: 'AWS::Region' },
36
- warmerName.toLowerCase(),
37
- 'role',
38
- ],
39
- ],
40
- },
41
- AssumeRolePolicyDocument: {
42
- Version: '2012-10-17',
43
- Statement: [
44
- {
45
- Effect: 'Allow',
46
- Principal: {
47
- Service: [
48
- 'lambda.amazonaws.com',
49
- ],
50
- },
51
- Action: 'sts:AssumeRole',
52
- },
53
- ],
54
- },
55
- Policies: [
56
- {
57
- PolicyName: {
58
- 'Fn::Join': [
59
- '-',
60
- [
61
- service.service,
62
- stage,
63
- 'warmer',
64
- warmerName.toLowerCase(),
65
- 'policy',
66
- ],
67
- ],
68
- },
69
- PolicyDocument: {
70
- Version: '2012-10-17',
71
- Statement: [
72
- {
73
- Effect: 'Allow',
74
- Action: [
75
- 'logs:CreateLogGroup',
76
- 'logs:CreateLogStream',
77
- ],
78
- Resource: [{
79
- 'Fn::Sub': `arn:\${AWS::Partition}:logs:\${AWS::Region}:\${AWS::AccountId}:log-group:/aws/lambda/${warmerConfig.name}:*`,
80
- }],
81
- },
82
- {
83
- Effect: 'Allow',
84
- Action: [
85
- 'logs:PutLogEvents',
86
- ],
87
- Resource: [{
88
- 'Fn::Sub': `arn:\${AWS::Partition}:logs:\${AWS::Region}:\${AWS::AccountId}:log-group:/aws/lambda/${warmerConfig.name}:*:*`,
89
- }],
90
- },
91
- {
92
- Effect: 'Allow',
93
- Action: [
94
- 'lambda:InvokeFunction',
95
- ],
96
- Resource: warmerConfig.functions.map((fn) => ({
97
- 'Fn::Sub': `arn:\${AWS::Partition}:lambda:\${AWS::Region}:\${AWS::AccountId}:function:${fn.name}*`,
98
- })),
99
- },
100
- {
101
- Effect: 'Allow',
102
- Action: [
103
- 'ec2:CreateNetworkInterface',
104
- 'ec2:DescribeNetworkInterfaces',
105
- 'ec2:DetachNetworkInterface',
106
- 'ec2:DeleteNetworkInterface',
107
- ],
108
- Resource: '*',
109
- },
110
- ],
111
- },
112
- },
113
- ],
114
- },
115
- };
13
+ // eslint-disable-next-line no-param-reassign
14
+ warmerConfig.role = `WarmUpPlugin${capitalize(warmerName)}Role`;
15
+ if (typeof service.resources !== 'object') {
16
+ // eslint-disable-next-line no-param-reassign
17
+ service.resources = {};
18
+ }
19
+ if (typeof service.resources.Resources !== 'object') {
20
+ // eslint-disable-next-line no-param-reassign
21
+ service.resources.Resources = {};
22
+ }
23
+
24
+ // eslint-disable-next-line no-param-reassign
25
+ service.resources.Resources[warmerConfig.role] = {
26
+ Type: 'AWS::IAM::Role',
27
+ Properties: {
28
+ Path: '/',
29
+ RoleName: warmerConfig.roleName || {
30
+ 'Fn::Join': [
31
+ '-',
32
+ [service.service, stage, { Ref: 'AWS::Region' }, warmerName.toLowerCase(), 'role'],
33
+ ],
34
+ },
35
+ AssumeRolePolicyDocument: {
36
+ Version: '2012-10-17',
37
+ Statement: [
38
+ {
39
+ Effect: 'Allow',
40
+ Principal: {
41
+ Service: ['lambda.amazonaws.com'],
42
+ },
43
+ Action: 'sts:AssumeRole',
44
+ },
45
+ ],
46
+ },
47
+ Policies: [
48
+ {
49
+ PolicyName: {
50
+ 'Fn::Join': [
51
+ '-',
52
+ [service.service, stage, 'warmer', warmerName.toLowerCase(), 'policy'],
53
+ ],
54
+ },
55
+ PolicyDocument: {
56
+ Version: '2012-10-17',
57
+ Statement: [
58
+ {
59
+ Effect: 'Allow',
60
+ Action: ['logs:CreateLogGroup', 'logs:CreateLogStream'],
61
+ Resource: [
62
+ {
63
+ 'Fn::Sub': `arn:\${AWS::Partition}:logs:\${AWS::Region}:\${AWS::AccountId}:log-group:/aws/lambda/${warmerConfig.name}:*`,
64
+ },
65
+ ],
66
+ },
67
+ {
68
+ Effect: 'Allow',
69
+ Action: ['logs:PutLogEvents'],
70
+ Resource: [
71
+ {
72
+ 'Fn::Sub': `arn:\${AWS::Partition}:logs:\${AWS::Region}:\${AWS::AccountId}:log-group:/aws/lambda/${warmerConfig.name}:*:*`,
73
+ },
74
+ ],
75
+ },
76
+ {
77
+ Effect: 'Allow',
78
+ Action: ['lambda:InvokeFunction'],
79
+ Resource: warmerConfig.functions.map((fn) => ({
80
+ 'Fn::Sub': `arn:\${AWS::Partition}:lambda:\${AWS::Region}:\${AWS::AccountId}:function:${fn.name}*`,
81
+ })),
82
+ },
83
+ {
84
+ Effect: 'Allow',
85
+ Action: [
86
+ 'ec2:CreateNetworkInterface',
87
+ 'ec2:DescribeNetworkInterfaces',
88
+ 'ec2:DetachNetworkInterface',
89
+ 'ec2:DeleteNetworkInterface',
90
+ ],
91
+ Resource: '*',
92
+ },
93
+ ],
94
+ },
95
+ },
96
+ ],
97
+ },
98
+ };
116
99
  }
117
100
 
118
101
  /**
@@ -126,19 +109,24 @@ function addWarmUpFunctionRoleToResources(service, stage, warmerName, warmerConf
126
109
  * @return {Promise}
127
110
  * */
128
111
  async function createWarmUpFunctionArtifact(functions, tracing, verbose, region, handlerFolder) {
129
- const warmUpFunction = `
112
+ const warmUpFunction = `
130
113
  /** Generated by Serverless WarmUp Plugin **/
131
114
 
132
115
  import { LambdaClient, InvokeCommand } from '@aws-sdk/client-lambda';
116
+ import { NodeHttpHandler } from '@smithy/node-http-handler';
133
117
 
134
118
  const uninstrumentedLambdaClient = new LambdaClient({
135
119
  apiVersion: '2015-03-31',
136
- region: '${region}'
120
+ region: '${region}',
121
+ requestHandler: new NodeHttpHandler({ connectionTimeout: 1000 }),
137
122
  });
138
123
 
139
- ${tracing
140
- ? 'const lambdaClient = AWSXRay.captureAWSv3Client(uninstrumentedLambdaClient);'
141
- : 'const lambdaClient = uninstrumentedLambdaClient;'}
124
+ ${
125
+ tracing
126
+ ? `import * as AWSXRay from 'aws-xray-sdk';
127
+ const lambdaClient = AWSXRay.captureAWSv3Client(uninstrumentedLambdaClient);`
128
+ : 'const lambdaClient = uninstrumentedLambdaClient;'
129
+ }
142
130
 
143
131
  const functions = ${JSON.stringify(functions, null, ' ')};
144
132
 
@@ -200,48 +188,48 @@ export const warmUp = async (event, context) => {
200
188
  logVerbose(\`Warm Up Finished with \${invokes.filter(r => !r).length} invoke errors\`);
201
189
  }`;
202
190
 
203
- /** Write warm up file */
204
- await fs.mkdir(handlerFolder, { recursive: true });
205
- await fs.writeFile(path.join(handlerFolder, 'index.mjs'), warmUpFunction);
191
+ /** Write warm up file */
192
+ await fs.mkdir(handlerFolder, { recursive: true });
193
+ await fs.writeFile(path.join(handlerFolder, 'index.mjs'), warmUpFunction);
206
194
 
207
- if (tracing) {
208
- await execAsync('npm init -y', { cwd: handlerFolder });
209
- await execAsync('npm install --save aws-xray-sdk-core', { cwd: handlerFolder });
210
- }
195
+ if (tracing) {
196
+ await execAsync('npm init -y', { cwd: handlerFolder });
197
+ await execAsync('npm install --save aws-xray-sdk-core', { cwd: handlerFolder });
198
+ }
211
199
  }
212
200
 
213
201
  /**
214
202
  * @description Add warmer function to service
215
203
  * */
216
204
  function addWarmUpFunctionToService(service, warmerName, warmerConfig) {
217
- // eslint-disable-next-line no-param-reassign
218
- service.functions[`warmUpPlugin${capitalize(warmerName)}`] = {
219
- description: `Serverless WarmUp Plugin (warmer "${warmerName}")`,
220
- events: warmerConfig.events,
221
- handler: warmerConfig.pathHandler.split(path.sep).join(path.posix.sep),
222
- memorySize: warmerConfig.memorySize,
223
- name: warmerConfig.name,
224
- ...(warmerConfig.architecture ? { architecture: warmerConfig.architecture } : {}),
225
- runtime: 'nodejs20.x',
226
- package: warmerConfig.package,
227
- timeout: warmerConfig.timeout,
228
- ...(Object.keys(warmerConfig.environment).length
229
- ? { environment: warmerConfig.environment }
230
- : {}),
231
- ...(warmerConfig.tracing !== undefined ? { tracing: warmerConfig.tracing } : {}),
232
- ...(warmerConfig.logRetentionInDays !== undefined
233
- ? { logRetentionInDays: warmerConfig.logRetentionInDays }
234
- : {}),
235
- ...(warmerConfig.roleName ? { roleName: warmerConfig.roleName } : {}),
236
- ...(warmerConfig.role ? { role: warmerConfig.role } : {}),
237
- ...(warmerConfig.tags ? { tags: warmerConfig.tags } : {}),
238
- ...(warmerConfig.vpc ? { vpc: warmerConfig.vpc } : {}),
239
- layers: [],
240
- };
205
+ // eslint-disable-next-line no-param-reassign
206
+ service.functions[`warmUpPlugin${capitalize(warmerName)}`] = {
207
+ description: `Serverless WarmUp Plugin (warmer "${warmerName}")`,
208
+ events: warmerConfig.events,
209
+ handler: warmerConfig.pathHandler.split(path.sep).join(path.posix.sep),
210
+ memorySize: warmerConfig.memorySize,
211
+ name: warmerConfig.name,
212
+ ...(warmerConfig.architecture ? { architecture: warmerConfig.architecture } : {}),
213
+ runtime: 'nodejs24.x',
214
+ package: warmerConfig.package,
215
+ timeout: warmerConfig.timeout,
216
+ ...(Object.keys(warmerConfig.environment).length
217
+ ? { environment: warmerConfig.environment }
218
+ : {}),
219
+ ...(warmerConfig.tracing !== undefined ? { tracing: warmerConfig.tracing } : {}),
220
+ ...(warmerConfig.logRetentionInDays !== undefined
221
+ ? { logRetentionInDays: warmerConfig.logRetentionInDays }
222
+ : {}),
223
+ ...(warmerConfig.roleName ? { roleName: warmerConfig.roleName } : {}),
224
+ ...(warmerConfig.role ? { role: warmerConfig.role } : {}),
225
+ ...(warmerConfig.tags ? { tags: warmerConfig.tags } : {}),
226
+ ...(warmerConfig.vpc ? { vpc: warmerConfig.vpc } : {}),
227
+ layers: [],
228
+ };
241
229
  }
242
230
 
243
231
  module.exports = {
244
- addWarmUpFunctionRoleToResources,
245
- createWarmUpFunctionArtifact,
246
- addWarmUpFunctionToService,
232
+ addWarmUpFunctionRoleToResources,
233
+ createWarmUpFunctionArtifact,
234
+ addWarmUpFunctionToService,
247
235
  };
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- coverage
2
- test_integration