Skip to content

Commit cd59a3f

Browse files
author
Daniel Conde
committed
fix Quantity field for LambdaAssociations
1 parent 3776117 commit cd59a3f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

__tests__/__snapshots__/lambda-at-edge.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Object {
6464
"LambdaFunctionARN": "arn:aws:lambda:us-east-1:123:function:viewerResponseFunction",
6565
},
6666
],
67-
"Quantity": 1,
67+
"Quantity": 4,
6868
},
6969
"MaxTTL": 10,
7070
"MinTTL": 10,

__tests__/lambda-at-edge.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('Input origin as a custom url', () => {
3838
assertHasCacheBehavior(mockCreateDistribution, {
3939
PathPattern: '/some/path',
4040
LambdaFunctionAssociations: {
41-
Quantity: 1,
41+
Quantity: 4,
4242
Items: [
4343
{
4444
EventType: 'viewer-request',

lib/parseInputOrigins.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ module.exports = (origins) => {
3535
)
3636
}
3737

38-
cacheBehavior.LambdaFunctionAssociations.Quantity = 1
38+
cacheBehavior.LambdaFunctionAssociations.Quantity =
39+
cacheBehavior.LambdaFunctionAssociations.Quantity + 1
3940
cacheBehavior.LambdaFunctionAssociations.Items.push({
4041
EventType: eventType,
4142
LambdaFunctionARN: lambdaAtEdge[eventType],

0 commit comments

Comments
 (0)