Comparing version 0.0.7 to 0.0.8
@@ -13,2 +13,3 @@ const { program } = require("commander"); | ||
.option("--edge-lambda-kill-warm-instances", "kill warm edge lambda instances by doing a silent redeployment") | ||
.option("--lambda-kill-warm-instances", "kill warm lambda instances by doing a silent redeployment") | ||
.option("--task-definition <task-definition>", "ecs task definition") | ||
@@ -51,6 +52,7 @@ .option("--container-name <container-name>", "container name") | ||
if (options["lambdaKillWarmInstances"]) | ||
Lib.lambdaKillWarmInstances(options["lambdaFunction"], resultFunc); | ||
// TODO: lambda version based routing deploy | ||
// TODO: run temporarily on fargate | ||
// TODO: lambda flush cache normal lambda | ||
// TODO: run task on aws/fargate |
{ | ||
"name": "awsass", | ||
"description": "AWSASS is an assistant to AWS, mostly for running better scripts.", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"author": "Jsonize", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/jsonize/awsass", |
@@ -141,2 +141,29 @@ const AWS = require("aws-sdk"); | ||
}); | ||
}, | ||
lambdaKillWarmInstances: function (lambdaFunction, callback) { | ||
const lambda = new AWS.Lambda({apiVersion: '2015-03-31'}); | ||
lambda.getFunctionConfiguration({ | ||
FunctionName: lambdaFunction, | ||
}, function (err, functionConfiguration) { | ||
if (err) { | ||
callback(err); | ||
return; | ||
} | ||
functionConfiguration.Environment.Variables.AWSASS = "" + (new Date()).getTime(); | ||
lambda.updateFunctionConfiguration({ | ||
FunctionName: lambdaFunction, | ||
Environment: functionConfiguration.Environment | ||
}, function (err) { | ||
if (err) { | ||
callback(err); | ||
return; | ||
} | ||
setTimeout(function () { | ||
lambda.publishVersion({ | ||
FunctionName: lambdaFunction | ||
}, callback); | ||
}, 5000); | ||
}); | ||
}); | ||
} | ||
@@ -143,0 +170,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
10961
221