Add/update filtered-sum-bms benchmark
This commit is contained in:
22
spot-launcher/deleteOldAlarms.js
Executable file
22
spot-launcher/deleteOldAlarms.js
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/env zx
|
||||
|
||||
import { exit } from "process";
|
||||
|
||||
const regions = JSON.parse(await $`aws ec2 describe-regions`).Regions.map(r => r.RegionName).filter(r => r.startsWith("us-") || r.startsWith("eu-"));
|
||||
|
||||
console.log("Available regions:", regions);
|
||||
|
||||
let pricings = []
|
||||
|
||||
for (const region of regions) {
|
||||
let alarms = JSON.parse(await $`aws cloudwatch describe-alarms --region ${region}`).MetricAlarms;
|
||||
|
||||
// Delete alarms that have InsufficientData state
|
||||
|
||||
for (const alarm of alarms) {
|
||||
if (alarm.StateValue === "INSUFFICIENT_DATA") {
|
||||
console.log(`Deleting alarm: ${alarm.AlarmName} in region ${region}`);
|
||||
await $`aws cloudwatch delete-alarms --alarm-names ${alarm.AlarmName} --region ${region}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user