Finding AWS Resources by IP Address
Finding EC2 Instances by IP Address
In the EC2 Console
In the AWS EC2 Management Console, you can search for EC2 instances using a private or public IP address. Filter by either
Private IP address or
Public IPv4 address in the search field:
Using the AWS CLI
The AWS CLI can be used to find EC2 instances by either private or public IP address.
Using a Private IP Address
To find EC2 instances by private IP address, the command looks like this (Replace
--region with your region if it’s not set by default. Replace
Values with the IP address):
Using a Public IP Address
To find EC2 instances by public IP address, the
Name filter changes to
ip-address but otherwise the command is the same as the one from above:
Specifying Multiple IP Addresses
For either of these commands, you can specify several IP addresses by adding them to the
Values filter as such:
The output for these commands will look something like this:
Finding Other Resources by IP Address
In the AWS Console
To identify other AWS resources (such as Lambdas) based on IP address, you can search for the corresponding ENI. In the AWS Console, browse to the EC2 console and click on Network Interfaces on the left hand side. Then search by “Primary private IPv4 address” (or “Public IPv4 address” if you want to search by a public IP address).
You can then poke around through the ENI details to figure out what resource is associated with the IP address.
Using the AWS CLI
This can also be done using the AWS CLI with the following command, replacing
Values as needed:
Here’s what the output looks like
Check the value of
InterfaceType for clues as to what resource is using the ENI. In this case, it’s a Lambda function.
Thanks to this Serverfault post for information regarding EC2 Instances: https://serverfault.com/questions/710931/is-it-possible-to-get-aws-ec2-instance-id-based-on-its-ip-address
Thanks to this AWS support page for the information regarding ENIs: How can I find the resource that owns the unknown IP addresses in my Amazon VPC?