Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mapbox/magic-cfn-resources

Package Overview
Dependencies
Maintainers
163
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/magic-cfn-resources - npm Package Compare versions

Comparing version 1.2.5 to 1.2.6

2

lib/build.js

@@ -60,3 +60,3 @@ // builds cfn resources for lambda function

CustomResource[params.LogicalName] = {
Type: cf.join('',['Custom::',params.CustomResourceName]),
Type: 'Custom::'+params.CustomResourceName,
Properties: Object.assign({ ServiceToken: cf.getAtt(`${params.LogicalName}Function`, 'Arn')}, params.Properties)

@@ -63,0 +63,0 @@ };

{
"name": "@mapbox/magic-cfn-resources",
"version": "1.2.5",
"version": "1.2.6",
"description": "Build Lambda-backed custom CloudFormation resources",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -207,27 +207,29 @@ const build = require('../lib/build').build;

test('[build] success on SnsSubscription', assert => {
const template = build({
CustomResourceName: 'SnsSubscription',
LogicalName: 'SnsSubscriptionLogicalName',
S3Key: 'lambda/code',
S3Bucket: 'code',
Handler: 'my.handler',
Properties: {
Protocol: 'email',
TopicArn: 'arn:aws:sns:us-east-1:special-topic',
Endpoint: 'someone@mapbox.com'
}
});
test('[build] success on SnsSubscription', assert => {
const template = build({
CustomResourceName: 'SnsSubscription',
LogicalName: 'SnsSubscriptionLogicalName',
S3Key: 'lambda/code',
S3Bucket: 'code',
Handler: 'my.handler',
Properties: {
Protocol: 'email',
TopicArn: 'arn:aws:sns:us-east-1:special-topic',
Endpoint: 'someone@mapbox.com'
}
});
assert.deepEquals(Object.keys(template.Resources), ['SnsSubscriptionLogicalNameRole', 'SnsSubscriptionLogicalNameFunction', 'SnsSubscriptionLogicalName'], 'role, function, and custom resource use logical name');
assert.equals(template.Resources.SnsSubscriptionLogicalNameRole.Type, 'AWS::IAM::Role', 'Type is AWS::IAM::Role');
assert.equals(template.Resources.SnsSubscriptionLogicalNameFunction.Type, 'AWS::Lambda::Function', 'Type is AWS::Lambda::Function');
assert.equals(template.Resources.SnsSubscriptionLogicalNameFunction.Properties.Code.S3Bucket, 'code', 'S3Bucket is params.S3Bucket');
assert.deepEquals(template.Resources.SnsSubscriptionLogicalNameFunction.Properties.Code.S3Key, 'lambda/code', 'S3Key is params.S3Key');
assert.deepEqual(template.Resources.SnsSubscriptionLogicalName.Type,'Custom::SnsSubscription', 'Type equals Custom::SnSSubnscription');
assert.ok( typeof template.Resources.SnsSubscriptionLogicalName.Type === 'string', 'Resource Type name is a string');
assert.equals(template.Resources.SnsSubscriptionLogicalNameFunction.Properties.Handler, 'my.handler', 'Handler is params.Handler');
assert.end();
});
assert.deepEquals(Object.keys(template.Resources), ['SnsSubscriptionLogicalNameRole', 'SnsSubscriptionLogicalNameFunction', 'SnsSubscriptionLogicalName'], 'role, function, and custom resource use logical name');
assert.equals(template.Resources.SnsSubscriptionLogicalNameRole.Type, 'AWS::IAM::Role', 'Type is AWS::IAM::Role');
assert.equals(template.Resources.SnsSubscriptionLogicalNameFunction.Type, 'AWS::Lambda::Function', 'Type is AWS::Lambda::Function');
assert.equals(template.Resources.SnsSubscriptionLogicalNameFunction.Properties.Code.S3Bucket, 'code', 'S3Bucket is params.S3Bucket');
assert.deepEquals(template.Resources.SnsSubscriptionLogicalNameFunction.Properties.Code.S3Key, 'lambda/code', 'S3Key is params.S3Key');
assert.equals(template.Resources.SnsSubscriptionLogicalNameFunction.Properties.Handler, 'my.handler', 'Handler is params.Handler');
assert.end();
});
test('[build] success with Conditional', assert => {

@@ -255,4 +257,5 @@ var params = {

assert.equals(template.Resources.SpotFleetLogicalName.Condition, 'Conditional', 'Conditional in Custom Resource');
assert.deepEqual(template.Resources.SpotFleetLogicalName.Type, { 'Fn::Join': [ '', [ 'Custom::', params.CustomResourceName ] ] }, 'Type equals Custom::params.CustomResourceName');
assert.deepEqual(template.Resources.SpotFleetLogicalName.Type,'Custom::'+params.CustomResourceName, 'Type equals Custom::params.CustomResourceName');
assert.ok( typeof template.Resources.SpotFleetLogicalName.Type === 'string', 'Resource Type name is a string');
assert.end();
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc