New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

serverless-provisioned-concurrency-autoscaling

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-provisioned-concurrency-autoscaling - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

23

lib/aws/policy.js

@@ -18,5 +18,9 @@ "use strict";

const Target = this.name.target(this.data.function);
const DependsOn = [Target, this.name.PCAliasLogicalId(this.data.function)].concat(this.dependencies);
const metricSpecificationJson = this.data.customMetric ?
this.customMetricJson(this.data.customMetric) : this.predfinedMetricJson();
const DependsOn = [
Target,
this.name.PCAliasLogicalId(this.data.function),
].concat(this.dependencies);
const metricSpecificationJson = this.data.customMetric
? this.customMetricJson(this.data.customMetric)
: this.predfinedMetricJson();
return {

@@ -39,3 +43,3 @@ [PolicyName]: {

PredefinedMetricType: 'LambdaProvisionedConcurrencyUtilization',
}
},
};

@@ -46,8 +50,11 @@ }

CustomizedMetricSpecification: {
Dimensions: (customMetric.dimensions || []).map(d => ({ Name: d.name, Value: d.value })),
Dimensions: (customMetric.dimensions || []).map((d) => ({
Name: d.name,
Value: d.value,
})),
MetricName: customMetric.metricName,
Namespace: customMetric.namespace,
Statistic: utility_1.ucfirst(customMetric.statistic || ""),
Unit: customMetric.unit
}
Statistic: utility_1.ucfirst(customMetric.statistic || ''),
Unit: customMetric.unit,
},
};

@@ -54,0 +61,0 @@ }

@@ -48,2 +48,7 @@ "use strict";

};
const schema = {
properties: {
concurrencyAutoscaling: { type: ['boolean', 'object'] },
},
};
class Plugin {

@@ -53,2 +58,6 @@ constructor(serverless) {

this.serverless = serverless;
if (this.serverless.configSchemaHandler &&
this.serverless.configSchemaHandler.defineFunctionProperties) {
this.serverless.configSchemaHandler.defineFunctionProperties('aws', schema);
}
this.hooks = {

@@ -67,4 +76,7 @@ 'package:compileEvents': this.beforeDeployResources.bind(this),

defaults(config) {
const customMetricConfig = config.customMetric ?
{ customMetric: this.customMetricDefaults(config.customMetric, config.name) } : {};
const customMetricConfig = config.customMetric
? {
customMetric: this.customMetricDefaults(config.customMetric, config.name),
}
: {};
return Object.assign({ maximum: config.maximum || 10, minimum: config.minimum || 1, scaleInCooldown: config.scaleInCooldown || 120, scaleOutCooldown: config.scaleOutCooldown || 0, usage: config.usage || 0.75, function: config.function, name: config.name }, customMetricConfig);

@@ -75,9 +87,9 @@ }

{
name: "FunctionName",
name: 'FunctionName',
value: functionName,
},
{
name: "Resource",
name: 'Resource',
value: `${functionName}:provisioned`,
}
},
];

@@ -84,0 +96,0 @@ return {

{
"name": "serverless-provisioned-concurrency-autoscaling",
"version": "1.1.1",
"version": "1.2.0",
"description": "Serverless Plugin for AWS Lambdas Provisioned Concurrency Auto Scaling configuration.",

@@ -22,2 +22,3 @@ "main": "./lib/index.js",

"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"test": "jest --silent",

@@ -56,3 +57,3 @@ "test:coverage": "jest --coverage --silent",

"@types/node": "^14.0.27",
"@types/serverless": "^1.72.5",
"@types/serverless": "^1.78.13",
"@typescript-eslint/eslint-plugin": "^3.8.0",

@@ -59,0 +60,0 @@ "@typescript-eslint/parser": "^3.8.0",

@@ -28,3 +28,3 @@ ![logo](https://github.com/neiman-marcus/serverless-provisioned-concurrency-autoscaling/raw/master/images/logo-small.png 'Neiman Marcus')

Add `concurrencyAutoscaling` parameters under each function you wish to autoscale in your `serverless.yml`.
Add `concurrencyAutoscaling` parameters under each function you wish to autoscale in your `serverless.yml`.

@@ -42,3 +42,3 @@ Add `customMetric: true` if you want to use `Maximum` instead of `Average` statistic.

# full configuration
# full configuration

@@ -45,0 +45,0 @@ world:

Sorry, the diff of this file is not supported yet

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