Skip to content

Instantly share code, notes, and snippets.

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