Why are the S3 CloudTrail events empty for my bucket?

0

I'm trying to find CloudTrail events for my-s3-bucket which can show me which account or resource is enabling events or other properties on the bucket. I thought API calls were logged by CloudTrail by default, but my event list is empty. Is my aws-cli command incorrect, or am I missing a configuration item on my bucket to enable API logging?

$  aws cloudtrail lookup-events --lookup-attributes AttributeKey=ResourceType,AttributeValue=AWS::S3::my-s3-bucket
{
    "Events": []
}
Thomas
已提問 2 個月前檢視次數 324 次
1 個回答
2
已接受的答案

Hello.

It depends on what kind of events you are looking for, but by default it only records API history at the bucket level.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/cloudtrail-logging-s3-info.html

Also, I think your command has the "AttributeValue" wrong.
If "AttributeKey" is "ResourceType", you need to enter the resource type "AWS::S3::Bucket" as shown below.

aws cloudtrail lookup-events --lookup-attributes AttributeKey=ResourceType,AttributeValue=AWS::S3::Bucket

If you want to search by resource name, you need to do the following:

aws cloudtrail lookup-events --lookup-attributes AttributeKey=ResourceName,AttributeValue=S3-BucketName
profile picture
專家
已回答 2 個月前
profile picture
專家
已審閱 2 個月前
profile pictureAWS
專家
已審閱 2 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南