aws-amicleaner 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib.js +11 -1
- package/package.json +1 -1
package/lib.js
CHANGED
|
@@ -72,7 +72,17 @@ export async function fetchInUseAMIIDs(ec2, autoscaling) {
|
|
|
72
72
|
const ltLimit = pLimit(5);
|
|
73
73
|
for await (const page of ltPaginator) {
|
|
74
74
|
await Promise.all(
|
|
75
|
-
page.LaunchTemplates.map(({LaunchTemplateId: id, DefaultVersionNumber: version}) => ltLimit(async () => {
|
|
75
|
+
page.LaunchTemplates.map(({LaunchTemplateId: id, DefaultVersionNumber: version}) => ltLimit(async () => {
|
|
76
|
+
const data = await ec2.send(new DescribeLaunchTemplateVersionsCommand({
|
|
77
|
+
LaunchTemplateId: id,
|
|
78
|
+
Versions: [version]
|
|
79
|
+
}));
|
|
80
|
+
inUseAMIIDs.add(data.LaunchTemplateVersions[0].LaunchTemplateData.ImageId);
|
|
81
|
+
}))
|
|
82
|
+
);
|
|
83
|
+
// CloudFormation does not update the default version of a launch template, therefore we are also considering the latest version as being used
|
|
84
|
+
await Promise.all(
|
|
85
|
+
page.LaunchTemplates.map(({LaunchTemplateId: id, LatestVersionNumber: version}) => ltLimit(async () => {
|
|
76
86
|
const data = await ec2.send(new DescribeLaunchTemplateVersionsCommand({
|
|
77
87
|
LaunchTemplateId: id,
|
|
78
88
|
Versions: [version]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aws-amicleaner",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "To clean up your AWS AMIs: First, include AMIs by name or tag. Second, exclude AMIs in use, younger than N days, or the newest N images. Third, manually confirm the list of AMIs for deletion.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": "index.js",
|