serverless-default-aws-resource-attributes
Advanced tools
Comparing version 0.0.5 to 0.1.0
@@ -10,5 +10,5 @@ 'use strict'; | ||
this.provider = serverless.getProvider('aws'); | ||
this.serverless = serverless.service; | ||
this.service = serverless.service; | ||
this.hooks = { | ||
'before:package:finalize': this.addDefaults.bind(this) | ||
'aws:package:finalize:mergeCustomProviderResources': this.addDefaults.bind(this) | ||
}; | ||
@@ -18,3 +18,3 @@ } | ||
getDefaults() { | ||
return this.serverless.custom.defaultAwsAttributes || {}; | ||
return this.service.custom.defaultAwsAttributes || {}; | ||
} | ||
@@ -37,3 +37,3 @@ | ||
const resources = this.serverless.resources.Resources; | ||
const resources = this.service.provider.compiledCloudFormationTemplate.Resources; | ||
@@ -40,0 +40,0 @@ for(const logicalId of Object.keys(resources)) { |
{ | ||
"name": "serverless-default-aws-resource-attributes", | ||
"version": "0.0.5", | ||
"version": "0.1.0", | ||
"description": "Set default attributes a given CloudFormation resource should have based on type", | ||
@@ -9,3 +9,5 @@ "main": "index.js", | ||
"deploy": "publish", | ||
"test": "nyc mocha test/**.js" | ||
"test": "npm run test:unit", | ||
"test:samples": "mocha test/samples/**.js", | ||
"test:unit": "nyc mocha test/unit/**.js" | ||
}, | ||
@@ -29,2 +31,3 @@ "repository": { | ||
"chai": "^4.3.4", | ||
"cross-spawn": "^7.0.3", | ||
"mocha": "^9.1.3", | ||
@@ -31,0 +34,0 @@ "nyc": "^15.1.0", |
@@ -10,2 +10,6 @@ [![CircleCI](https://circleci.com/gh/neverendingqs/serverless-default-aws-resource-attributes.svg?style=svg)](https://circleci.com/gh/neverendingqs/serverless-default-aws-resource-attributes) | ||
This plugin **affects resources generated by Serverless**. | ||
For example, any default attributes defined for S3 buckets will be applied to the Serverless-generated `ServerlessDeploymentBucket` bucket. | ||
You are, however, able to exclude Serverless-generated resources using `Exclude:` (see below). | ||
## Usage | ||
@@ -12,0 +16,0 @@ |
Sorry, the diff of this file is not supported yet
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
30932
15
299
58
6
1
1