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

dawson-snippets

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dawson-snippets - npm Package Compare versions

Comparing version 0.17.0 to 0.17.1

__tests__/dynamodb-backup.spec.js

34

__tests__/s3-bucket.spec.js

@@ -1,2 +0,1 @@

const test = require('ava');

@@ -6,2 +5,3 @@ const merge = require('lodash/merge');

const s3Bucket = require('../s3-bucket');
const s3BucketVersioning = require('../s3-bucket-versioning');
const s3BucketCors = require('../s3-bucket-cors');

@@ -39,2 +39,34 @@ const s3BucketNotification = require('../s3-bucket-notification');

/* s3BucketVersioning */
const VERSIONED_BUCKET = {
Resources: {
AdminBucket: {
Type: 'AWS::S3::Bucket',
Properties: {
VersioningConfiguration: {
Status: 'Enabled'
}
},
DeletionPolicy: 'Retain'
}
},
Outputs: {
AdminBucket: {
Value: { Ref: 'AdminBucket' }
}
}
};
test('AdminBucket', t => {
t.deepEqual(VERSIONED_BUCKET, {
Resources: s3BucketVersioning({ bucketLogicalName: 'AdminBucket' }),
Outputs: {
AdminBucket: {
Value: { Ref: 'AdminBucket' }
}
}
});
});
/* *** */
/* s3BucketCors */

@@ -41,0 +73,0 @@ const USER_BUCKET = {

11

dynamodb-backup/index.js

@@ -29,5 +29,3 @@ const lambdaNameTemplate = tableLogicalName =>

Action: ['s3:PutObject'],
Resource: [
{ 'Fn::Sub': `arn:aws:s3:::\${${bucketLogicalName}}/*` }
]
Resource: [{ 'Fn::Sub': `arn:aws:s3:::\${${bucketLogicalName}}/*` }]
},

@@ -69,3 +67,6 @@ {

},
[`${lambdaNameTemplate(tableLogicalName)}Role`]: lambdaRoleTemplate(tableLogicalName, bucketLogicalName),
[`${lambdaNameTemplate(tableLogicalName)}Role`]: lambdaRoleTemplate(
tableLogicalName,
bucketLogicalName
),
[lambdaName]: {

@@ -129,2 +130,2 @@ Type: 'AWS::Lambda::Function',

};
}
};
{
"name": "dawson-snippets",
"version": "0.17.0",
"version": "0.17.1",
"description": "Snippets for CloudFormation templates",

@@ -10,3 +10,4 @@ "repository": {

"scripts": {
"test": "ava"
"test": "ava",
"format": "prettier-eslint --write **/*.js"
},

@@ -19,4 +20,22 @@ "author": "Simone Lusenti <simone@plasticpanda.com>",

"homepage": "https://github.com/dawson-org/dawson-snippets#readme",
"eslintConfig": {
"extends": [
"semistandard"
],
"rules": {
"object-curly-spacing": [
2,
"always"
]
}
},
"devDependencies": {
"ava": "^0.18.1"
"ava": "^0.18.1",
"eslint": "^3.15.0",
"eslint-config-semistandard": "^7.0.0",
"eslint-config-standard": "^6.2.1",
"eslint-plugin-promise": "^3.4.1",
"eslint-plugin-standard": "^2.0.1",
"lodash": "^4.17.4",
"prettier": "^0.17.0"
},

@@ -23,0 +42,0 @@ "engines": {

@@ -14,4 +14,15 @@ # dawson-snippets

For usage instructions see the README files in each folder.
Snippets are composable and are designed to be merged using `lodash.merge` or any similar deep-merge function. Snippets provides Resources objects that you can attach to a dawson application using [processCFTemplate() or customTemplateFragment()](https://github.com/dawson-org/dawson-cli/blob/master/docs/README.md#6-working-with-the-template).
Snippets are composable and are designed to be merged using `lodash.merge` or any similar deep-merge function. Snippets provides `Resources` objects that you can attach to a `dawson` application using [processCFTemplate() or customTemplateFragment()](https://github.com/dawson-org/dawson-cli/blob/master/docs/README.md#6-working-with-the-template).
`dawson-snippets` is dependency-free; it should be used with the `dawson` package of the same version (major.minor).
### Resource Names
Many snippets will take one or many `logicalName` parameter(s). Each `*LogicalName` you provide must be **unique** in a whole `CloudFormation Template`.
Resources Physical Names will be created automatically by `CloudFormation`.
Resources Physical (real) Names and ARNs should be accessed using `Ref`, `Fn::Sub`, `Fn::GetAtt` functions and shall never be hardcoded into your apps.
## License

@@ -18,0 +29,0 @@

@@ -1,3 +0,2 @@

const makePolicyLogicalName = bucketLogicalName =>
`${bucketLogicalName}Policy`;
const makePolicyLogicalName = bucketLogicalName => `${bucketLogicalName}Policy`;

@@ -4,0 +3,0 @@ module.exports = params => {

Sorry, the diff of this file is not supported yet

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