diff --git a/aws/aws-inventory.sh b/aws/aws-inventory.sh new file mode 100755 index 0000000..7261516 --- /dev/null +++ b/aws/aws-inventory.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Generate inventory of ec2, rds, lb, and s3 buckets. + +echo "# EC2" +aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId, Tags[?Key==`Name`].Value[] | [0], Platform, InstanceType]' --output text | nl + +echo "# RDS" +aws rds describe-db-instances --query 'DBInstances[*].[DBInstanceIdentifier, DBInstanceClass, Engine, AllocatedStorage]' --output text | nl + +echo "# elasticache" +aws elasticache describe-cache-clusters --query 'CacheClusters[*].[CacheClusterId, CacheNodeType, Engine, EngineVersion]' --output text | nl + +echo "# LB" +aws elb describe-load-balancers --query 'LoadBalancerDescriptions[*].[LoadBalancerName,Scheme]' --output text | nl + +echo "# VPC" +aws ec2 describe-vpcs --query 'Vpcs[*].[VpcId, CidrBlock]' --output text | nl + +echo "# S3buckets" +aws s3api list-buckets --output text | awk '{print $NF}' | nl + +echo "# ECS" +aws ecs list-clusters | jq -cr '.[][]' | awk -F/ '{print $NF}' | nl + +echo "# EKS" +aws eks list-clusters | jq '.[][]' | awk -F/ '{print $NF}' | nl + +echo "# CloudFront" +aws cloudfront list-distributions --query 'DistributionList.Items[*].[DomainName]' --output text | nl