Answers for "get ip from instance id boto3"

1

get ip from instance id boto3

import boto3
ec2 = boto3.client("ec2")
res = ec2.describe_instances(InstanceIds=['<instance-id>',])
print(res["Reservations"][0]["Instances"][0]["PublicIpAddress"])
Posted by: Guest on February-28-2022

Python Answers by Framework

Browse Popular Code Answers by Language