@mapbox/cloudfriend
Advanced tools
Comparing version 8.1.0-dev.2 to 8.1.0
@@ -1,1 +0,1 @@ | ||
{"processes":{"35aa325a-f140-4f80-9616-95761c59175e":{"parent":"a5f87e50-cfde-4941-8875-256437709f71","children":[]}},"files":{"/Users/branyip/src/cloudfriend/bin/build-template.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/index.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/intrinsic.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/conditions.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/rules.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/pseudo.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/build.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/validate.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/merge.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/index.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/lambda.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/service-role.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/role.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/scheduled-lambda.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/event-lambda.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/queue-lambda.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/stream-lambda.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/cross-account-role.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/queue.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/s3-kinesis-firehose.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/kinesis-firehose-base.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/glue-database.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/glue-table.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/glue-json-table.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/glue-orc-table.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/glue-parquet-table.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/glue-presto-view.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/glue-spark-view.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/hookshot.js":["35aa325a-f140-4f80-9616-95761c59175e"],"/Users/branyip/src/cloudfriend/lib/shortcuts/log-subscription-lambda.js":["35aa325a-f140-4f80-9616-95761c59175e"]},"externalIds":{}} | ||
{"processes":{"c5b5c951-37d5-4058-a3e4-939c91352f33":{"parent":null,"children":["d9683579-e4df-4a8c-916b-585093031713"]},"d9683579-e4df-4a8c-916b-585093031713":{"parent":"c5b5c951-37d5-4058-a3e4-939c91352f33","children":[]}},"files":{"/Users/bilindhajer/cloudfriend/index.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/intrinsic.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/conditions.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/rules.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/pseudo.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/build.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/validate.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/merge.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/index.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/lambda.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/service-role.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/role.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/scheduled-lambda.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/event-lambda.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/queue-lambda.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/stream-lambda.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/cross-account-role.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/queue.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/s3-kinesis-firehose.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/kinesis-firehose-base.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/glue-database.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/glue-table.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/glue-json-table.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/glue-orc-table.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/glue-parquet-table.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/glue-presto-view.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/glue-spark-view.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/hookshot.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/lib/shortcuts/log-subscription-lambda.js":["c5b5c951-37d5-4058-a3e4-939c91352f33","d9683579-e4df-4a8c-916b-585093031713"],"/Users/bilindhajer/cloudfriend/bin/build-template.js":["d9683579-e4df-4a8c-916b-585093031713"]},"externalIds":{}} |
@@ -5,3 +5,3 @@ # Changelog | ||
- Allow `FilterCriteria` property to be defined for Lambda shortcuts | ||
- Allow `FilterCriteria` property to be defined for Stream Lambda shortcuts | ||
@@ -8,0 +8,0 @@ ## 8.0.0 |
@@ -799,6 +799,23 @@ ## Classes | ||
}, | ||
EventSourceArn: cf.getAtt('MyStream', 'Arn') | ||
EventSourceArn: cf.getAtt('MyStream', 'Arn'), | ||
}); | ||
module.exports = cf.merge(myTemplate, lambda); | ||
// This lambda only gets invoked for 'INSERT' events for the DynamoDb event source | ||
const lambdaWithFilterCriteria = new cf.shortcuts.StreamLambda({ | ||
LogicalName: 'MyLambdaWithFilterCriteria', | ||
Code: { | ||
S3Bucket: 'my-code-bucket', | ||
S3Key: 'path/to/code.zip' | ||
}, | ||
EventSourceArn: cf.getAtt('MyDynamoDbStream', 'Arn'), | ||
FilterCriteria: { | ||
Filters: [ | ||
{ | ||
Pattern: JSON.stringify({ eventName: ['INSERT'] }), | ||
} | ||
] | ||
} | ||
}); | ||
module.exports = cf.merge(myTemplate, lambda, lambdaWithFilterCriteria); | ||
``` |
@@ -29,6 +29,23 @@ 'use strict'; | ||
* }, | ||
* EventSourceArn: cf.getAtt('MyStream', 'Arn') | ||
* EventSourceArn: cf.getAtt('MyStream', 'Arn'), | ||
* }); | ||
* | ||
* module.exports = cf.merge(myTemplate, lambda); | ||
* // This lambda only gets invoked for 'INSERT' events for the DynamoDb event source | ||
* const lambdaWithFilterCriteria = new cf.shortcuts.StreamLambda({ | ||
* LogicalName: 'MyLambdaWithFilterCriteria', | ||
* Code: { | ||
* S3Bucket: 'my-code-bucket', | ||
* S3Key: 'path/to/code.zip' | ||
* }, | ||
* EventSourceArn: cf.getAtt('MyDynamoDbStream', 'Arn'), | ||
* FilterCriteria: { | ||
* Filters: [ | ||
* { | ||
* Pattern: JSON.stringify({ eventName: ['INSERT'] }), | ||
* } | ||
* ] | ||
* } | ||
* }); | ||
* | ||
* module.exports = cf.merge(myTemplate, lambda, lambdaWithFilterCriteria); | ||
*/ | ||
@@ -72,5 +89,2 @@ class StreamLambda extends Lambda { | ||
} | ||
if (FilterCriteria.Filters.length > 5){ | ||
throw new Error('`FilterCriteria.Filter` cannot contain more than 5 items, you may request a quota increase with AWS support if required.'); | ||
} | ||
for (const filter of FilterCriteria.Filters){ | ||
@@ -77,0 +91,0 @@ if (!filter.Pattern){ |
{ | ||
"name": "@mapbox/cloudfriend", | ||
"version": "8.1.0-dev.2", | ||
"version": "8.1.0", | ||
"description": "Helper functions for assembling CloudFormation templates in JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -552,35 +552,2 @@ 'use strict'; | ||
{ | ||
Pattern: JSON.stringify({ eventName: ['1'] }) | ||
}, | ||
{ | ||
Pattern: JSON.stringify({ eventName: ['2'] }) | ||
}, | ||
{ | ||
Pattern: JSON.stringify({ eventName: ['3'] }) | ||
}, | ||
{ | ||
Pattern: JSON.stringify({ eventName: ['4'] }) | ||
}, | ||
{ | ||
Pattern: JSON.stringify({ eventName: ['5'] }) | ||
}, | ||
{ | ||
Pattern: JSON.stringify({ eventName: ['6'] }) | ||
} | ||
] | ||
} | ||
}), | ||
'`FilterCriteria.Filter` cannot contain more than 5 items, you may request a quota increase with AWS support if required.', | ||
); | ||
assert.throws( | ||
() => new cf.shortcuts.StreamLambda({ | ||
LogicalName: 'MyLambda', | ||
Code: { | ||
S3Bucket: 'my-code-bucket', | ||
S3Key: 'path/to/code.zip' | ||
}, | ||
EventSourceArn: 'arn:aws:kinesis:us-east-1:123456789012:stream/fake', | ||
FilterCriteria: { | ||
Filters: [ | ||
{ | ||
NotPattern: JSON.stringify({ eventName: ['INSERT', 'MODIFY'] }) | ||
@@ -587,0 +554,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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
737796
0
117
14454