  def GetBootVolume(self) -> 'ebs.AWSVolume':
    """Get the instance's boot volume.

    Returns:
      AWSVolume: Volume object if the volume is found.

    Raises:
      ResourceNotFoundError: If no boot volume could be found.
    """

    boot_device = self.aws_account.ResourceApi(
        common.EC2_SERVICE).Instance(self.instance_id).root_device_name
    volumes = self.ListVolumes()

    for volume_id in volumes:
      if volumes[volume_id].device_name == boot_device:
        return volumes[volume_id]

    raise errors.ResourceNotFoundError(
        'Boot volume not found for instance: {0:s}'.format(self.instance_id),
        __name__)
Get the instance's boot volume.

Returns:
AWSVolume: Volume object if the volume is found.

Raises:
ResourceNotFoundError: If no boot volume could be found.
libcloudforensics/providers/aws/internal/ec2.py