NEW: added inventory scripts for emr, lambda, subnet
This commit is contained in:
parent
4073242080
commit
d157bedcf6
|
@ -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
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
function listRes() {
|
||||
aws --region $1 lambda list-functions | jq -cr '.Functions[] | [.FunctionName, .Runtime, .Architectures[]] | @csv' | tr -d \"
|
||||
}
|
||||
|
||||
export -f listRes
|
||||
|
||||
# Generate inventory in all regions
|
||||
|
||||
echo "FunctionName, Runtime, Architecture"
|
||||
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
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
function listRes() {
|
||||
aws --region $1 ec2 describe-subnets | jq -cr '.Subnets[] | [.SubnetId, .VpcId, .CidrBlock, .AvailabilityZone] | @csv' | tr -d \"
|
||||
}
|
||||
|
||||
export -f listRes
|
||||
|
||||
# Generate inventory in all regions
|
||||
|
||||
echo "SubnetId,VpcId,CidrBlock,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
|
Loading…
Reference in New Issue