Skip to content

Instantly share code, notes, and snippets.

Created Jul 9, 2021
What would you like to do?
import boto3
ec2 = boto3.resource("ec2")
for instance in ec2.instances.all():
public_ip = instance.public_ip_address
if public_ip:
print(, public_ip, "public")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment