Is there a way to get a list of all assigned IPs in an AWS subnet? Furthermore, if there is a way to see the associated (AW)Services? That would be incredibly helpful as well. Thanks!
EDIT:
All assigned private IPs in a private AWS Subnet (which are retained regardless of instance state). Any means of obtaining this information will do. I am most familiar with AWS CLI, boto/boto3 and the console.
The list would include all avail per CIDR block definition except for 5 addresses:
aws ec2 describe-instances --filters "Name=subnet-id,Values=subnet-12345678" --query 'Reservations[*].Instances[*].PrivateIpAddress' --output text
describe-instances
subnet-id
PrivateIpAddress
Using @Michael - sqlbot's suggestion:
aws ec2 describe-network-interfaces --filters "Name=subnet-id,Values=subnet-12345678" --query 'NetworkInterfaces[*].PrivateIpAddress'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With