def get_instance_infos(reservations):
    """ Get instance infos """
    if len(reservations) == 0:
        print('No instance found matching this input.')
        exit()
    reservation = reservations[0]['Instances'][0]
    if reservation.get('PublicIpAddress'):
        return {'id': reservation['InstanceId'], 'public_ip': reservation.
            get('PublicIpAddress'), 'private_ip': reservation.get(
            'PrivateIpAddress'), 'type': reservation.get('InstanceType'),
            'vpc': reservation.get('VpcId'), 'subnet': reservation.get(
            'SubnetId'), 'launch_date': str(reservation.get('LaunchTime')) if
            reservation.get('LaunchTime') else None, 'tags': reservation.
            get('Tags')}
    print('No public IP found for this instance.')
    exit()
