@mapbox/cloudfriend
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -0,1 +1,5 @@ | ||
## v2.0.1 | ||
- various shortcut bugfixes. See https://github.com/mapbox/cloudfriend/pull/34 | ||
## v2.0.0 | ||
@@ -2,0 +6,0 @@ |
@@ -47,3 +47,3 @@ <!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
- `options.MemorySize` **[Number][31]** See [AWS documentation][32] (optional, default `128`) | ||
- `options.ReservedConcurrencyExecutions` **[Number][31]** See [AWS documentation][33] (optional, default `undefined`) | ||
- `options.ReservedConcurrentExecutions` **[Number][31]** See [AWS documentation][33] (optional, default `undefined`) | ||
- `options.Runtime` **[String][23]** See [AWS documentation][34] (optional, default `'nodejs8.10'`) | ||
@@ -140,4 +140,5 @@ - `options.Tags` **[Array][35]<[Object][22]>** See [AWS documentation][36] (optional, default `undefined`) | ||
function][2] with the following additional attributes: (optional, default `{}`) | ||
- `options.EventSourceArn` **[String][23]** See [AWS documentation][54] | ||
- `options.ReservedConcurrencyExecutions` **[Number][31]** See [AWS documentation][33] | ||
- `options.BatchSize` **[Number][31]** See [AWS documentation][54] (optional, default `1`) | ||
- `options.EventSourceArn` **[String][23]** See [AWS documentation][55] | ||
- `options.ReservedConcurrentExecutions` **[Number][31]** See [AWS documentation][33] | ||
@@ -158,3 +159,3 @@ ### Examples | ||
EventSourceArn: cf.getAtt('MyQueue', 'Arn'), | ||
ReservedConcurrencyExecutions: 30 | ||
ReservedConcurrentExecutions: 30 | ||
}); | ||
@@ -178,4 +179,4 @@ | ||
function][2] with the following additional attributes: (optional, default `{}`) | ||
- `options.EventSourceArn` **[String][23]** See [AWS documentation][54] | ||
- `options.BatchSize` **[Number][31]** See [AWS documentation][55] (optional, default `1`) | ||
- `options.EventSourceArn` **[String][23]** See [AWS documentation][55] | ||
- `options.BatchSize` **[Number][31]** See [AWS documentation][54] (optional, default `1`) | ||
- `options.Enabled` **[Boolean][56]** See [AWS documentation][57] (optional, default `true`) | ||
@@ -263,3 +264,3 @@ - `options.StartingPosition` **[String][23]** See [AWS documentation][58] (optional, default `'LATEST'`) | ||
- `options.VisibilityTimeout` **[Number][31]** See [AWS documentation][64] (optional, default `300`) | ||
- `options.maxReceiveCount` **[Number][31]** See [AWS documentation][65] (optional, default `300`) | ||
- `options.maxReceiveCount` **[Number][31]** See [AWS documentation][65] (optional, default `10`) | ||
- `options.ContentBasedDeduplication` **[Boolean][56]** See [AWS documentation][66] (optional, default `undefined`) | ||
@@ -405,5 +406,5 @@ - `options.DelaySeconds` **[Number][31]** See [AWS documentation][67] (optional, default `undefined`) | ||
[54]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn | ||
[54]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize | ||
[55]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize | ||
[55]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn | ||
@@ -410,0 +411,0 @@ [56]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean |
@@ -22,3 +22,3 @@ 'use strict'; | ||
* @param {Number} [options.MemorySize=128] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-memorysize) | ||
* @param {Number} [options.ReservedConcurrencyExecutions=undefined] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-reservedconcurrentexecutions) | ||
* @param {Number} [options.ReservedConcurrentExecutions=undefined] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-reservedconcurrentexecutions) | ||
* @param {String} [options.Runtime='nodejs8.10'] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-runtime) | ||
@@ -74,3 +74,3 @@ * @param {Array<Object>} [options.Tags=undefined] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tags) | ||
MemorySize = 128, | ||
ReservedConcurrencyExecutions, | ||
ReservedConcurrentExecutions, | ||
Runtime = Code && Code.ZipFile ? 'nodejs6.10' : 'nodejs8.10', | ||
@@ -171,3 +171,3 @@ Tags, | ||
MemorySize, | ||
ReservedConcurrencyExecutions, | ||
ReservedConcurrentExecutions, | ||
Role: { 'Fn::GetAtt': [`${LogicalName}Role`, 'Arn'] }, | ||
@@ -174,0 +174,0 @@ Runtime, |
@@ -13,4 +13,5 @@ 'use strict'; | ||
* 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 {String} options.EventSourceArn See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn) | ||
* @param {Number} options.ReservedConcurrencyExecutions See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-reservedconcurrentexecutions) | ||
* @param {Number} options.ReservedConcurrentExecutions See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-reservedconcurrentexecutions) | ||
* | ||
@@ -29,3 +30,3 @@ * @example | ||
* EventSourceArn: cf.getAtt('MyQueue', 'Arn'), | ||
* ReservedConcurrencyExecutions: 30 | ||
* ReservedConcurrentExecutions: 30 | ||
* }); | ||
@@ -39,7 +40,11 @@ * | ||
const { EventSourceArn, ReservedConcurrencyExecutions } = options; | ||
const { | ||
BatchSize = 1, | ||
EventSourceArn, | ||
ReservedConcurrentExecutions | ||
} = options; | ||
const required = [EventSourceArn, ReservedConcurrencyExecutions]; | ||
const required = [EventSourceArn, ReservedConcurrentExecutions]; | ||
if (required.some((variable) => !variable)) | ||
throw new Error('You must provide an EventSourceArn and ReservedConcurrencyExecutions'); | ||
throw new Error('You must provide an EventSourceArn and ReservedConcurrentExecutions'); | ||
@@ -53,4 +58,5 @@ const { Enabled = true } = options; | ||
Enabled, | ||
BatchSize, | ||
EventSourceArn, | ||
FunctionName: this.FunctionName | ||
FunctionName: { Ref: this.LogicalName } | ||
} | ||
@@ -64,3 +70,4 @@ }; | ||
'sqs:DeleteMessage', | ||
'sqs:ReceiveMessage' | ||
'sqs:ReceiveMessage', | ||
'sqs:GetQueueAttributes' | ||
], | ||
@@ -67,0 +74,0 @@ Resource: [ |
@@ -16,3 +16,3 @@ 'use strict'; | ||
* @param {Number} [options.VisibilityTimeout=300] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues.html#aws-sqs-queue-visibilitytimeout) | ||
* @param {Number} [options.maxReceiveCount=300] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues-redrivepolicy.html#aws-sqs-queue-redrivepolicy-maxcount) | ||
* @param {Number} [options.maxReceiveCount=10] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues-redrivepolicy.html#aws-sqs-queue-redrivepolicy-maxcount) | ||
* @param {Boolean} [options.ContentBasedDeduplication=undefined] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues.html#cfn-sqs-queue-contentbaseddeduplication) | ||
@@ -112,6 +112,8 @@ * @param {Number} [options.DelaySeconds=undefined] See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues.html#aws-sqs-queue-delayseconds) | ||
DisplayName, | ||
Subscription: { | ||
Endpoint: { 'Fn::GetAtt': [LogicalName, 'Arn'] }, | ||
Protocol: 'sqs' | ||
} | ||
Subscription: [ | ||
{ | ||
Endpoint: { 'Fn::GetAtt': [LogicalName, 'Arn'] }, | ||
Protocol: 'sqs' | ||
} | ||
] | ||
} | ||
@@ -118,0 +120,0 @@ }, |
@@ -56,3 +56,3 @@ 'use strict'; | ||
EventSourceArn, | ||
FunctionName: this.FunctionName, | ||
FunctionName: { Ref: this.LogicalName }, | ||
StartingPosition | ||
@@ -59,0 +59,0 @@ } |
{ | ||
"name": "@mapbox/cloudfriend", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Helper functions for assembling CloudFormation templates in JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -49,3 +49,3 @@ # cloudfriend | ||
Cloudfriend contains a library of JS classes that reduce the amount of "boilerplate" CloudFormation that you need to write in order to setup a common set of AWS Resources. See [the shortcuts readme for more information](./shortcuts/readme.md). | ||
Cloudfriend contains a library of JS classes that reduce the amount of "boilerplate" CloudFormation that you need to write in order to setup a common set of AWS Resources. See [the shortcuts readme for more information](./lib/shortcuts/readme.md). | ||
@@ -52,0 +52,0 @@ ## Other helpers |
@@ -94,3 +94,3 @@ { | ||
"MemorySize": 512, | ||
"ReservedConcurrencyExecutions": 10, | ||
"ReservedConcurrentExecutions": 10, | ||
"Role": { | ||
@@ -97,0 +97,0 @@ "Fn::GetAtt": [ |
@@ -50,11 +50,13 @@ { | ||
}, | ||
"Subscription": { | ||
"Endpoint": { | ||
"Fn::GetAtt": [ | ||
"MyQueue", | ||
"Arn" | ||
] | ||
}, | ||
"Protocol": "sqs" | ||
} | ||
"Subscription": [ | ||
{ | ||
"Endpoint": { | ||
"Fn::GetAtt": [ | ||
"MyQueue", | ||
"Arn" | ||
] | ||
}, | ||
"Protocol": "sqs" | ||
} | ||
] | ||
} | ||
@@ -61,0 +63,0 @@ }, |
@@ -61,11 +61,13 @@ { | ||
"DisplayName": "topic-display-name", | ||
"Subscription": { | ||
"Endpoint": { | ||
"Fn::GetAtt": [ | ||
"MyQueue", | ||
"Arn" | ||
] | ||
}, | ||
"Protocol": "sqs" | ||
} | ||
"Subscription": [ | ||
{ | ||
"Endpoint": { | ||
"Fn::GetAtt": [ | ||
"MyQueue", | ||
"Arn" | ||
] | ||
}, | ||
"Protocol": "sqs" | ||
} | ||
] | ||
} | ||
@@ -72,0 +74,0 @@ }, |
@@ -59,3 +59,4 @@ { | ||
"sqs:DeleteMessage", | ||
"sqs:ReceiveMessage" | ||
"sqs:ReceiveMessage", | ||
"sqs:GetQueueAttributes" | ||
], | ||
@@ -95,3 +96,3 @@ "Resource": [ | ||
"MemorySize": 128, | ||
"ReservedConcurrencyExecutions": 10, | ||
"ReservedConcurrentExecutions": 10, | ||
"Role": { | ||
@@ -146,5 +147,6 @@ "Fn::GetAtt": [ | ||
"Enabled": true, | ||
"BatchSize": 1, | ||
"EventSourceArn": "arn:aws:sqs:us-east-1:123456789012:queue/fake", | ||
"FunctionName": { | ||
"Fn::Sub": "${AWS::StackName}-MyLambda" | ||
"Ref": "MyLambda" | ||
} | ||
@@ -151,0 +153,0 @@ } |
@@ -152,3 +152,3 @@ { | ||
"FunctionName": { | ||
"Fn::Sub": "${AWS::StackName}-MyLambda" | ||
"Ref": "MyLambda" | ||
}, | ||
@@ -155,0 +155,0 @@ "StartingPosition": "LATEST" |
@@ -82,3 +82,3 @@ 'use strict'; | ||
MemorySize: 512, | ||
ReservedConcurrencyExecutions: 10, | ||
ReservedConcurrentExecutions: 10, | ||
Runtime: 'nodejs6.10', | ||
@@ -144,3 +144,3 @@ Tags: [{ Key: 'a', Value: 'b' }], | ||
}), | ||
/You must provide an EventSourceArn and ReservedConcurrencyExecutions/, | ||
/You must provide an EventSourceArn and ReservedConcurrentExecutions/, | ||
'throws without queue-lambda required parameters' | ||
@@ -156,3 +156,3 @@ ); | ||
EventSourceArn: 'arn:aws:sqs:us-east-1:123456789012:queue/fake', | ||
ReservedConcurrencyExecutions: 10 | ||
ReservedConcurrentExecutions: 10 | ||
}); | ||
@@ -159,0 +159,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
146538
3354
0