@mapbox/cloudfriend
Advanced tools
Comparing version 3.5.0 to 3.6.0
@@ -0,1 +1,5 @@ | ||
# v3.6.0 | ||
- Adds support for the `MaximumBatchingWindowInSeconds` property of an event source mapping within the `StreamLambda` shortcut | ||
# v3.5.0 | ||
@@ -2,0 +6,0 @@ |
@@ -9,3 +9,3 @@ <!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
- [Examples][4] | ||
- [EventLambda][5] | ||
- [ScheduledLambda][5] | ||
- [Parameters][6] | ||
@@ -123,3 +123,3 @@ - [Examples][7] | ||
## EventLambda | ||
## ScheduledLambda | ||
@@ -677,3 +677,3 @@ **Extends Lambda** | ||
[5]: #eventlambda | ||
[5]: #scheduledlambda | ||
@@ -684,3 +684,3 @@ [6]: #parameters-1 | ||
[8]: #eventlambda-1 | ||
[8]: #eventlambda | ||
@@ -687,0 +687,0 @@ [9]: #parameters-2 |
@@ -38,3 +38,3 @@ 'use strict'; | ||
*/ | ||
class EventLambda extends Lambda { | ||
class ScheduledLambda extends Lambda { | ||
constructor(options = {}) { | ||
@@ -95,2 +95,2 @@ super(options); | ||
module.exports = EventLambda; | ||
module.exports = ScheduledLambda; |
@@ -10,3 +10,3 @@ 'use strict'; | ||
* | ||
* @param {Object} options configuration options for the scheduled Lambda | ||
* @param {Object} options configuration options for the stream Lambda | ||
* function and related resources. Extends [the `options` for a vanilla Lambda | ||
@@ -16,2 +16,3 @@ * function](#parameters) with the following additional attributes: | ||
* @param {Number} [options.BatchSize=1] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize) | ||
* @param {Number} [options.MaximumBatchingWindowInSeconds=undefined] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumbatchingwindowinseconds) | ||
* @param {Boolean} [options.Enabled=true] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled) | ||
@@ -43,2 +44,3 @@ * @param {String} [options.StartingPosition='LATEST'] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition) | ||
BatchSize = 1, | ||
MaximumBatchingWindowInSeconds, | ||
Enabled = true, | ||
@@ -57,2 +59,3 @@ StartingPosition = 'LATEST' | ||
BatchSize, | ||
MaximumBatchingWindowInSeconds, | ||
Enabled, | ||
@@ -59,0 +62,0 @@ EventSourceArn, |
{ | ||
"name": "@mapbox/cloudfriend", | ||
"version": "3.5.0", | ||
"version": "3.6.0", | ||
"description": "Helper functions for assembling CloudFormation templates in JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -325,3 +325,3 @@ 'use strict'; | ||
const lambda = new cf.shortcuts.StreamLambda({ | ||
let lambda = new cf.shortcuts.StreamLambda({ | ||
LogicalName: 'MyLambda', | ||
@@ -335,10 +335,31 @@ Code: { | ||
const template = cf.merge(lambda); | ||
if (update) fixtures.update('stream-lambda', template); | ||
let template = cf.merge(lambda); | ||
if (update) fixtures.update('stream-lambda-defaults', template); | ||
assert.deepEqual( | ||
noUndefined(template), | ||
fixtures.get('stream-lambda'), | ||
'expected resources generated' | ||
fixtures.get('stream-lambda-defaults'), | ||
'expected resources generated via defaults' | ||
); | ||
lambda = new cf.shortcuts.StreamLambda({ | ||
LogicalName: 'MyLambda', | ||
Code: { | ||
S3Bucket: 'my-code-bucket', | ||
S3Key: 'path/to/code.zip' | ||
}, | ||
EventSourceArn: 'arn:aws:sqs:us-east-1:123456789012:queue/fake', | ||
BatchSize: 10000, | ||
MaximumBatchingWindowInSeconds: 300, | ||
Enabled: false, | ||
StartingPosition: 'TRIM_HORIZON' | ||
}); | ||
template = cf.merge(lambda); | ||
if (update) fixtures.update('stream-lambda-no-defaults', template); | ||
assert.deepEqual( | ||
noUndefined(template), | ||
fixtures.get('stream-lambda-no-defaults'), | ||
'expected resources generated without defaults' | ||
); | ||
assert.end(); | ||
@@ -345,0 +366,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
344642
75
9415