def getinstancepublicip(instance):
    """Given a JSON instance, get its public IP address"""
    if "PublicIpAddress" in instance:
        return instance["PublicIpAddress"]
    else:
        return ""