UPD: touch up cosmetics
This commit is contained in:
parent
e5cdcfecde
commit
4493286990
|
@ -9,7 +9,7 @@ function formatprint() {
|
|||
}
|
||||
|
||||
function listEc2() {
|
||||
aws --region=$1 ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId, Tags[?Key==`Name`].Value[] | [0], PlatformDetails, InstanceType,PrivateIpAddress, PublicIpAddress, Placement.AvailabilityZone]' --output json | jq -cr '.[][] | @csv' | tr -d '[\" '
|
||||
aws --region=$1 ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId, Tags[?Key==`Name`].Value[] | [0], PlatformDetails, InstanceType,PrivateIpAddress, Placement.AvailabilityZone]' --output json | jq -cr '.[][] | @csv' | tr -d '[\" '
|
||||
}
|
||||
|
||||
export -f formatprint
|
||||
|
@ -17,7 +17,7 @@ export -f listEc2
|
|||
|
||||
# Generate inventory of ec2 in all regions
|
||||
|
||||
echo "InstanceId,NameTag,OsPlatform,InstanceType,PrivateIp,PublicIp,AZ"
|
||||
echo "InstanceId,NameTag,OsPlatform,InstanceType,PrivateIp,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 listEc2 $r
|
||||
done
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
function listRes() {
|
||||
aws elbv2 describe-load-balancers | jq -cr '.LoadBalancers[] | [.LoadBalancerName, .Scheme, .Type, .AvailabilityZones[0].ZoneName] | @csv' | tr -d \"
|
||||
aws --region $1 elbv2 describe-load-balancers | jq -cr '.LoadBalancers[] | [.LoadBalancerName, .Scheme, .Type, .AvailabilityZones[0].ZoneName] | @csv' | tr -d \"
|
||||
}
|
||||
|
||||
export -f listRes
|
||||
|
|
|
@ -2,5 +2,6 @@
|
|||
|
||||
for i in aws-ec2-inventory.sh aws-efs-inventory.sh aws-eks-inventory.sh aws-elasticache-inventory.sh aws-elasticsearch-inventory.sh aws-elbv2-inventory.sh aws-emr-inventory.sh aws-lambda-inventory.sh aws-rds-inventory.sh aws-route53-inventory.sh aws-s3-inventory.sh aws-subnet-inventory.sh aws-logs-inventory.sh aws-ecs-inventory.sh; do
|
||||
echo "# $i"
|
||||
bash $i
|
||||
bash $i | mlr --c2t cat | column -t
|
||||
wait $!
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue