CloudTrail でログを取得する設定を施す。
CloudTrail の「Event history (イベント履歴)」 をを選択して、「Athena テーブルを作成」 をクリック。CloudTrail のログを保存しているバケットを選択する。
Athena に行く。
上記により作成されたテーブル名(cloudtrail_logs_aws_cloudtrail_logs_xxxx のようになっているはず)を選択する。「テーブルをプレビュー」をクリックすると、10件表示される。SQL を適切に変更すれば、自分の知りたい情報を得ることができる。
(一例)
イベント名の数
SELECT COUNT(DISTINCT eventname) FROM "default"."cloudtrail_logs_aws_cloudtrail_logs_xxxx" AS "Number of eventnames";
イメージ作成
SELECT * FROM "default"."cloudtrail_logs_aws_cloudtrail_logs_xxxx" WHERE eventname = 'CreateImage';
(参考)
https://docs.aws.amazon.com/ja_jp/athena/latest/ug/cloudtrail-logs.html
(参考:AWS の Youtube ビデオ)
https://www.youtube.com/watch?v=xe2GSs1Tkyo
(SQL の参考)
https://aws.amazon.com/jp/premiumsupport/knowledge-center/athena-tables-search-cloudtrail-logs/?nc1=h_ls