Comparing version 0.0.21 to 0.0.22
{ | ||
"name": "awsass", | ||
"description": "AWSASS is an assistant to AWS, mostly for running better scripts.", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"author": "Jsonize", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/jsonize/awsass", |
@@ -361,12 +361,7 @@ const AWS = require("aws-sdk"); | ||
const cloudwatchlogs = new AWS.CloudWatchLogs({apiVersion: '2014-03-28'}); | ||
cloudwatchlogs.deleteLogGroup({ | ||
logGroupName: "/ecs/" + ephemeralId | ||
}, function (err, logGroupResult) { | ||
if (err) { | ||
callback(err); | ||
return; | ||
} | ||
ecs.deregisterTaskDefinition({ | ||
taskDefinition: ephemeralId + ":1" | ||
}, function (err, deregisterTaskDef) { | ||
const f = function () { | ||
ecr.deleteRepository({ | ||
repositoryName: ephemeralId, | ||
force: true | ||
}, function (err, deleteRepoResult) { | ||
if (err) { | ||
@@ -376,10 +371,5 @@ callback(err); | ||
} | ||
ecr.deleteRepository({ | ||
repositoryName: ephemeralId, | ||
force: true | ||
}, function (err, deleteRepoResult) { | ||
if (err) { | ||
callback(err); | ||
return; | ||
} | ||
cloudwatchlogs.deleteLogGroup({ | ||
logGroupName: "/ecs/" + ephemeralId | ||
}, function (err, logGroupResult) { | ||
callback(undefined, { | ||
@@ -392,2 +382,26 @@ ephemeralId: ephemeralId, | ||
}); | ||
}; | ||
ecs.listTaskDefinitions({ | ||
familyPrefix: ephemeralId | ||
}, function (err, deregisterTaskDefs) { | ||
if (err) { | ||
callback(err); | ||
return; | ||
} | ||
let allCount = 0; | ||
let counter = 0; | ||
deregisterTaskDefs.taskDefinitionArns.forEach(arn => { | ||
if (arn.indexOf(ephemeralId) >= 0) { | ||
allCount++; | ||
ecs.deregisterTaskDefinition({ | ||
taskDefinition: arn | ||
}, function () { | ||
counter++; | ||
if (counter === allCount) | ||
f(); | ||
}); | ||
} | ||
}); | ||
if (allCount === 0) | ||
f(); | ||
}); | ||
@@ -394,0 +408,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
33768
659