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 个月前326 查看次数
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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则