def is_amazon_ami(image_name):
  """Heuristic to tell if given image name is Amazon Linux image."""
  image_name = image_name.lower()
  return 'amzn' in image_name or 'amazon' in image_name or image_name.startswith('dlami23-efa') or image_name.startswith('basic-efa') or image_name.startswith('prepare-p3dn') or image_name.startswith('pytorch-efa')