View a markdown version of this page

Logging with CloudTrail for S3 Files - Amazon Simple Storage Service

Logging with CloudTrail for S3 Files

Amazon S3 Files is integrated with CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in S3 Files. CloudTrail captures all API calls for S3 Files as events, including calls from the S3 Files console and code calls to the S3 Files API operations.

If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for S3 Files. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in Event history. Using the information collected by CloudTrail, you can determine the request that was made to S3 Files, the IP address from which the request was made, who made the request, when it was made, and additional details.

S3 Files information in CloudTrail

CloudTrail is enabled on your AWS account when you create the account. When activity occurs in Amazon S3 Files, that activity is recorded in a CloudTrail event along with other AWS service events in Event history. You can view, search, and download recent events in your AWS account. For more information, see Viewing events with CloudTrail Event history in the CloudTrail User Guide.

For an ongoing record of events in your AWS account, including events for S3 Files, create a trail. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket. By default, when you create a trail in the console, the trail applies to all AWS Regions. The trail logs events from all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs.

For more information, see the following topics in the CloudTrail User Guide:

All S3 Files APIs are logged by CloudTrail. For example, calls to the CreateFileSystem, CreateMountTarget and TagResource operations generate entries in the CloudTrail log files. S3 Files also generates CloudTrail logs when you mount your file system on a compute resource.

Every event or log entry contains information about who generated the request. The identity information helps you determine the following:

  • Whether the request was made with root user or IAM user credentials.

  • Whether the request was made with temporary security credentials for a role or federated user.

  • Whether the request was made by another AWS service.

For more information, see CloudTrail userIdentity element in the CloudTrail User Guide.

S3 Files does not log data events. Data events include file read and write operations performed on the file system.

Understanding S3 Files log file entries

A trail is a configuration that enables delivery of events as log files to an Amazon S3 bucket that you specify. CloudTrail log files contain one or more log entries. An event represents a single request from any source and includes information about the requested action, the date and time of the action, request parameters, and so on. CloudTrail log files aren't an ordered stack trace of the public API calls, so they don't appear in any specific order.

Example: CreateFileSystem

The following example shows a CloudTrail log entry that demonstrates the CreateFileSystem action:

{ "eventVersion": "1.11", "userIdentity": { "type": "AssumedRole", "principalId": "111122223333", "arn": "arn:aws:sts::111122223333:assumed-role/myRole/i-0123456789abcdef0", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "111122223333", "arn": "arn:aws:iam::111122223333:role/myRole", "accountId": "111122223333", "userName": "myRole" }, "attributes": { "creationDate": "2026-03-20T12:58:28Z", "mfaAuthenticated": "false" }, "ec2RoleDelivery": "2.0" } }, "eventTime": "2026-03-20T17:43:19Z", "eventSource": "s3files.amazonaws.com", "eventName": "CreateFileSystem", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/2.0", "requestParameters": { "bucket": "arn:aws:s3:::amzn-s3-demo-bucket", "prefix": "images/", "clientToken": "myClientToken", "roleArn": "arn:aws:iam::111122223333:role/myS3FilesRole" }, "responseElements": { "creationTime": "Mar 20, 2026, 5:43:19 PM", "fileSystemArn": "arn:aws:s3files:us-west-2:111122223333:file-system/fs-abcd123456789ef0", "fileSystemId": "fs-abcd123456789ef0", "bucket": "arn:aws:s3:::amzn-s3-demo-bucket", "prefix": "images/", "clientToken": "myClientToken", "status": "creating", "roleArn": "arn:aws:iam::111122223333:role/myS3FilesRole", "ownerId": "111122223333", "tags": [] }, "requestID": "dEXAMPLE-feb4-11e6-85f0-736EXAMPLE75", "eventID": "eEXAMPLE-2d32-4619-bd00-657EXAMPLEe4", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::S3Files::FileSystem", "ARN": "arn:aws:s3files:us-west-2:111122223333:file-system/fs-abcd123456789ef0" } ], "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "111122223333", "eventCategory": "Management", "tlsDetails": { "tlsVersion": "TLSv1.3", "cipherSuite": "TLS_AES_128_GCM_SHA256", "clientProvidedHostHeader": "s3files.us-west-2.api.aws" } }

Example: CreateMountTarget

The following example shows a CloudTrail log entry for the CreateMountTarget action:

{ "eventVersion": "1.11", "userIdentity": { "type": "AssumedRole", "principalId": "111122223333", "arn": "arn:aws:sts::111122223333:assumed-role/myRole/i-0123456789abcdef0", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "111122223333", "arn": "arn:aws:iam::111122223333:role/myRole", "accountId": "111122223333", "userName": "myRole" }, "attributes": { "creationDate": "2026-03-20T13:09:56Z", "mfaAuthenticated": "false" }, "ec2RoleDelivery": "2.0" } }, "eventTime": "2026-03-20T18:05:14Z", "eventSource": "s3files.amazonaws.com", "eventName": "CreateMountTarget", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/2.0", "requestParameters": { "fileSystemId": "fs-abcd123456789ef0", "subnetId": "subnet-01234567890abcdef", "securityGroups": [ "sg-c16d65b6" ] }, "responseElements": { "availabilityZoneId": "usw2-az2", "ownerId": "111122223333", "mountTargetId": "fsmt-1234567", "fileSystemId": "fs-abcd123456789ef0", "subnetId": "subnet-01234567890abcdef", "ipv4Address": "192.0.2.0", "ipv6Address": "2001:db8::1", "networkInterfaceId": "eni-0123456789abcdef0", "vpcId": "vpc-01234567", "securityGroups": [ "sg-c16d65b6" ], "status": "creating" }, "requestID": "dEXAMPLE-feb4-11e6-85f0-736EXAMPLE75", "eventID": "eEXAMPLE-2d32-4619-bd00-657EXAMPLEe4", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::S3Files::FileSystem", "ARN": "arn:aws:s3files:us-west-2:111122223333:file-system/fs-abcd123456789ef0" }, { "accountId": "111122223333", "type": "AWS::S3Files::MountTarget", "ARN": "arn:aws:s3files:us-west-2:111122223333:mount-target/fsmt-1234567" }, { "accountId": "111122223333", "type": "AWS::EC2::Subnet", "ARN": "arn:aws:ec2:us-west-2:111122223333:subnet/subnet-01234567890abcdef" }, { "accountId": "111122223333", "type": "AWS::EC2::NetworkInterface", "ARN": "arn:aws:ec2:us-west-2:111122223333:network-interface/eni-0123456789abcdef0" } ], "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "111122223333", "eventCategory": "Management", "tlsDetails": { "tlsVersion": "TLSv1.3", "cipherSuite": "TLS_AES_128_GCM_SHA256", "clientProvidedHostHeader": "s3files.us-west-2.api.aws" } }