def attach_volume(DryRun=None, VolumeId=None, InstanceId=None, Device=None):
    """
    Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.
    Encrypted EBS volumes may only be attached to instances that support Amazon EBS encryption. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide .
    For a list of supported device names, see Attaching an EBS Volume to an Instance . Any device names that aren't reserved for instance store volumes can be used for EBS volumes. For more information, see Amazon EC2 Instance Store in the Amazon Elastic Compute Cloud User Guide .
    If a volume has an AWS Marketplace product code:
    For an overview of the AWS Marketplace, see Introducing AWS Marketplace .
    For more information about EBS volumes, see Attaching Amazon EBS Volumes in the Amazon Elastic Compute Cloud User Guide .
    See also: AWS API Documentation
    
    Examples
    This example attaches a volume (vol-1234567890abcdef0) to an instance (i-01474ef662b89480) as /dev/sdf.
    Expected Output:
    
    :example: response = client.attach_volume(
        DryRun=True|False,
        VolumeId='string',
        InstanceId='string',
        Device='string'
    )
    
    
    :type DryRun: boolean
    :param DryRun: Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

    :type VolumeId: string
    :param VolumeId: [REQUIRED]
            The ID of the EBS volume. The volume and instance must be within the same Availability Zone.
            

    :type InstanceId: string
    :param InstanceId: [REQUIRED]
            The ID of the instance.
            

    :type Device: string
    :param Device: [REQUIRED]
            The device name to expose to the instance (for example, /dev/sdh or xvdh ).
            

    :rtype: dict
    :return: {
        'VolumeId': 'string',
        'InstanceId': 'string',
        'Device': 'string',
        'State': 'attaching'|'attached'|'detaching'|'detached',
        'AttachTime': datetime(2015, 1, 1),
        'DeleteOnTermination': True|False
    }
    
    
    :returns: 
    DryRun (boolean) -- Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .
    VolumeId (string) -- [REQUIRED]
    The ID of the EBS volume. The volume and instance must be within the same Availability Zone.
    
    InstanceId (string) -- [REQUIRED]
    The ID of the instance.
    
    Device (string) -- [REQUIRED]
    The device name to expose to the instance (for example, /dev/sdh or xvdh ).
    
    
    """
    pass
