diff --git a/aws/aws-eks-inventory.sh b/aws/aws-eks-inventory.sh new file mode 100755 index 0000000..165635c --- /dev/null +++ b/aws/aws-eks-inventory.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +function listRes() { + aws --region $1 eks list-clusters --query clusters[] --output text | sed -e 's/\t/\n/g' | while read i; do + aws --region $1 eks describe-cluster --name $i | jq -cr '.cluster | [.name, .version] | @csv' | tr -d \" + done +} + +export -f listRes + +# Generate inventory of ec2 in all regions + +echo "ClusterName,ClusterVersion" +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 diff --git a/aws/aws-elasticache-inventory.sh b/aws/aws-elasticache-inventory.sh new file mode 100755 index 0000000..9aa82d2 --- /dev/null +++ b/aws/aws-elasticache-inventory.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +function listRes() { + aws elasticache --region $1 describe-cache-clusters | jq -cr '.CacheClusters[] | [.CacheClusterId, .CacheNodeType, .Engine, .PreferredAvailabilityZone] | @csv' | tr -d \" +} + +export -f listRes + +# Generate inventory of ec2 in all regions + +echo "ClusterId,NodeType,Engine,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 diff --git a/aws/aws-elasticsearch-inventory.sh b/aws/aws-elasticsearch-inventory.sh new file mode 100755 index 0000000..a9f58a9 --- /dev/null +++ b/aws/aws-elasticsearch-inventory.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +function listRes() { + aws --region $1 opensearch list-domain-names | jq -cr '.DomainNames[] | [.DomainName, .EngineType] | @csv' | tr -d \" +} + +export -f listRes + +# Generate inventory of ec2 in all regions + +echo "DomainName, EngineType" +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 diff --git a/aws/aws-rds-inventory.sh b/aws/aws-rds-inventory.sh new file mode 100755 index 0000000..b4d37ad --- /dev/null +++ b/aws/aws-rds-inventory.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +function listRes() { + aws rds describe-db-instances --region $1 | jq -cr '.DBInstances[] | [.DBInstanceIdentifier, .DBInstanceClass, .Engine, .AvailabilityZone, .MultiAZ] | @csv' | tr -d \" +} + +export -f listRes + +# Generate inventory of ec2 in all regions + +echo "InstanceId,InstanceClass,Engine,AZ,MultiAz" +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