Last active
June 22, 2020 09:12
-
-
Save Auronmatrix/02c708b3a458ddfbdddb340c328fe9cb to your computer and use it in GitHub Desktop.
aws cli - Lookup Unknown IP address across all regions
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
# Sources: | |
# https://aws.amazon.com/premiumsupport/knowledge-center/vpc-find-owner-unknown-ip-addresses/ | |
# https://github.com/aws/aws-cli/issues/1777 | |
for region in $(aws ec2 describe-regions --all-regions --query "Regions[*].RegionName" --output text --profile=<PROFILE>) | |
do | |
echo -e "\nLookup IP in region:'$region'..." | |
aws ec2 describe-network-interfaces --filters Name=association.public-ip,Values=<PUBLIC_IP> --profile=<PROFILE> --region=$region | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment