  def _GetBootVolumeConfigByAmi(self,
                                ami: str,
                                boot_volume_size: int,
                                boot_volume_type: str) -> Dict[str, Any]:
    """Return a boot volume configuration for a given AMI and boot volume size.

    Args:
      ami (str): The Amazon Machine Image ID.
      boot_volume_size (int): Size of the boot volume, in GB.
      boot_volume_type (str): Type of the boot volume.

    Returns:
      Dict[str, str|Dict]]: A BlockDeviceMappings configuration for the
          specified AMI.

    Raises:
      ResourceNotFoundError: If AMI details cannot be found.
    """

    client = self.aws_account.ClientApi(common.EC2_SERVICE)
    try:
      image = client.describe_images(ImageIds=[ami])
    except client.exceptions.ClientError as exception:
      raise errors.ResourceNotFoundError(
          'Could not find image information for AMI {0:s}: {1!s}'.format(
              ami, exception), __name__) from exception

    # If the call to describe_images was successful, then the API's response
    # is expected to contain at least one image and its corresponding block
    # device mappings information.
    # pylint: disable=line-too-long
    block_device_mapping = image['Images'][0]['BlockDeviceMappings'][0]  # type: Dict[str, Any]
    # pylint: enable=line-too-long
    block_device_mapping['Ebs']['VolumeSize'] = boot_volume_size
    block_device_mapping['Ebs']['VolumeType'] = boot_volume_type
    if boot_volume_type == 'io1':
      # If using the io1 volume type, we must specify Iops, see
      # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/
      # services/ec2.html#EC2.Client.create_volume. io1 volumes allow for a
      # ratio of 50 IOPS per 1 GiB.
      block_device_mapping['Ebs']['Iops'] = boot_volume_size * 50
    return block_device_mapping
Return a boot volume configuration for a given AMI and boot volume size.

Args:
ami (str): The Amazon Machine Image ID.
boot_volume_size (int): Size of the boot volume, in GB.
boot_volume_type (str): Type of the boot volume.

Returns:
Dict[str, str|Dict]]: A BlockDeviceMappings configuration for the
specified AMI.

Raises:
ResourceNotFoundError: If AMI details cannot be found.
libcloudforensics/providers/aws/internal/ec2.py