<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def attach_volume(volume_id, instance_id, device,
                  region=None, key=None, keyid=None, profile=None):
    '''
    Attach an EBS volume to an EC2 instance.
    ..

    volume_id
        (string) – The ID of the EBS volume to be attached.
    instance_id
        (string) – The ID of the EC2 instance to attach the volume to.
    device
        (string) – The device on the instance through which the volume is exposed (e.g. /dev/sdh)

    returns
        (bool) - True on success, False on failure.

    CLI Example:

    .. code-block:: bash

        salt-call boto_ec2.attach_volume vol-12345678 i-87654321 /dev/sdh

    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    try:
        return conn.attach_volume(volume_id, instance_id, device)
    except boto.exception.BotoServerError as error:
        log.error(error)
        return False