Skip to content

CloudTrail

CloudMock emulates AWS CloudTrail, supporting trail management, logging control, event selectors, insight selectors, event lookup, and tagging.

OperationStatusNotes
CreateTrailSupportedCreates a trail
GetTrailSupportedReturns trail details
DescribeTrailsSupportedLists all trails
DeleteTrailSupportedDeletes a trail
UpdateTrailSupportedUpdates trail configuration
StartLoggingSupportedStarts logging for a trail
StopLoggingSupportedStops logging for a trail
GetTrailStatusSupportedReturns trail logging status
PutEventSelectorsSupportedConfigures event selectors
GetEventSelectorsSupportedReturns event selectors
PutInsightSelectorsSupportedConfigures insight selectors
GetInsightSelectorsSupportedReturns insight selectors
LookupEventsSupportedReturns recorded events
AddTagsSupportedAdds tags to a trail
RemoveTagsSupportedRemoves tags from a trail
ListTagsSupportedLists tags for a trail
import { CloudTrailClient, CreateTrailCommand } from '@aws-sdk/client-cloudtrail';
const client = new CloudTrailClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
await client.send(new CreateTrailCommand({
Name: 'my-trail',
S3BucketName: 'my-trail-bucket',
}));
import boto3
client = boto3.client('cloudtrail',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
client.create_trail(
Name='my-trail',
S3BucketName='my-trail-bucket')
cloudmock.yml
services:
cloudtrail:
enabled: true
  • Events are recorded in-memory and do not persist to S3
  • LookupEvents returns internally recorded API calls, not comprehensive AWS event history
  • Insight events are not generated