Add/update filtered-sum-bms benchmark
This commit is contained in:
16
spot-launcher/terminateFleets.js
Executable file
16
spot-launcher/terminateFleets.js
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/env zx
|
||||
|
||||
const regions = JSON.parse(await $`aws ec2 describe-regions`).Regions.map(r => r.RegionName);
|
||||
|
||||
for (const region of regions) {
|
||||
console.log(`Checking for active fleets in region ${region}...`);
|
||||
const fleets = JSON.parse(await $`aws ec2 describe-fleets --region ${region} --filters Name=fleet-state,Values=active`).Fleets
|
||||
if (fleets.length > 0) {
|
||||
// console.log(fleets);
|
||||
console.log(`Terminating fleets in region ${region}:`);
|
||||
for (const fleet of fleets) {
|
||||
console.log(`- ${fleet.FleetId}`);
|
||||
await $`aws ec2 delete-fleets --region ${region} --fleet-id ${fleet.FleetId} --terminate-instances`;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user