  def AttachVolume(self,
                   volume: 'ebs.AWSVolume',
                   device_name: str) -> None:
    """Attach a volume to the AWS instance.

    Args:
      volume (AWSVolume): The AWSVolume object to attach to the instance.
      device_name (str): The device name for the volume (e.g. /dev/sdf).

    Raises:
      RuntimeError: If the volume could not be attached.
    """

    client = self.aws_account.ClientApi(common.EC2_SERVICE)
    try:
      client.attach_volume(Device=device_name,
                           InstanceId=self.instance_id,
                           VolumeId=volume.volume_id)
    except client.exceptions.ClientError as exception:
      raise RuntimeError('Could not attach volume {0:s}: {1:s}'.format(
          volume.volume_id, str(exception))) from exception

    volume.device_name = device_name
Attach a volume to the AWS instance.

Args:
volume (AWSVolume): The AWSVolume object to attach to the instance.
device_name (str): The device name for the volume (e.g. /dev/sdf).

Raises:
RuntimeError: If the volume could not be attached.
libcloudforensics/providers/aws/internal/ec2.py