NEW: Initial release

This commit is contained in:
KF
2024-04-19 14:09:45 +08:00
commit 122fe95f95
16 changed files with 233 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
function listRes() {
aws --region $1 emr list-clusters --query Clusters[].Id --output text | sed 's/\t/\n/g' | while read i; do
aws --region $1 emr describe-cluster --cluster-id $i | jq -cr '.Cluster | [.Id, .Name, .ReleaseLabel, .Ec2InstanceAttributes.Ec2AvailabilityZone] | @csv' | tr -d \"
done
}
export -f listRes
# Generate inventory of ec2 in all regions
echo "ClusterId,ClusterName,ReleaseLabel,AZ"
aws --region=us-east-1 ec2 describe-regions --query Regions[].RegionName --output text | sed -e 's/\t/\n/g' | while read r; do
sem -j6 listRes $r
done
sem --wait