Last active
April 6, 2020 23:29
-
-
Save Efrat19/0e5cfd7b8c6ce74fb2df52f497d9c8f0 to your computer and use it in GitHub Desktop.
count-interfaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare -a subnets=("subnet-0a5eeeb0cd492af31" "subnet-081a9964b79df659d" "subnet-0a223bb7af793f998") | |
for subnet in ${subnets[@]}; do | |
echo "$(aws ec2 describe-network-interfaces --filters "Name=subnet-id,Values=$subnet" --query 'NetworkInterfaces[*].PrivateIpAddress' --output text | wc -w) interfaces are taken at $subnet" | |
# echo "$(aws ec2 describe-instances --filters "Name=subnet-id,Values=$subnet" --query 'Reservations[*].Instances[*].PrivateIpAddress' --output text | wc -w) ips are taken at $subnet" | |
done; |
starchx
commented
Apr 6, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment