困っていること
Amazon が提供しているパブリック AMI の OwnerId 一覧表などがあれば教えてください。
どう対応すればいいの?
Command Reference を参考に、下記の AWS CLI コマンドで Amazon が所有する OwnerId の一覧を取得可能です。
やってみた
AWS CLI コマンド例と結果 (2023-01-22 現在)
$ aws ec2 describe-images --owners amazon --filters Name=is-public,Values=true --query 'Images[].OwnerId' | jq unique
[
"013907871322",
"099720109477",
"102837901569",
"136693071363",
"137112412989",
"164071883780",
"247102896272",
"302615239497",
"309956199498",
"366320600621",
"465558535106",
"490389498239",
"517802777641",
"591542846629",
"593245189075",
"602401143452",
"629888741976",
"663280808239",
"680152181751",
"746694360614",
"801119661308",
"877601337756",
"877902723034",
"898082745236",
"971168101600"
]
コマンド結果より取得される 12 桁の OwnerId を参考に、判断してください。