Expand description
This is the CloudTrail API Reference. It provides descriptions of actions, data types, common parameters, and common errors for CloudTrail.
CloudTrail is a web service that records AWS API calls for your AWS account and delivers log files to an Amazon S3 bucket. The recorded information includes the identity of the user, the start time of the AWS API call, the source IP address, the request parameters, and the response elements returned by the service.
As an alternative to the API, you can use one of the AWS SDKs, which consist of libraries and sample code for various programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to AWSCloudTrail. For example, the SDKs take care of cryptographically signing requests, managing errors, and retrying requests automatically. For information about the AWS SDKs, including how to download and install them, see the Tools for Amazon Web Services page.
See the AWS CloudTrail User Guide for information about the data that is included with each AWS API call listed in the log files.
If you’re using the service, you’re probably looking for CloudTrailClient and CloudTrail.
Structs§
- AddTags
Request Specifies the tags to add to a trail.
- AddTags
Response Returns the objects or data listed below if successful. Otherwise, returns an error.
- Advanced
Event Selector Advanced event selectors let you create fine-grained selectors for the following AWS CloudTrail event record fields. They help you control costs by logging only those events that are important to you. For more information about advanced event selectors, see Logging data events for trails in the AWS CloudTrail User Guide.
-
readOnly
-
eventSource
-
eventName
-
eventCategory
-
resources.type
-
resources.ARN
You cannot apply both event selectors and advanced event selectors to a trail.
-
- Advanced
Field Selector A single selector statement in an advanced event selector.
- Cloud
Trail Client - A client for the CloudTrail API.
- Create
Trail Request Specifies the settings for each trail.
- Create
Trail Response Returns the objects or data listed below if successful. Otherwise, returns an error.
- Data
Resource The Amazon S3 buckets, AWS Lambda functions, or Amazon DynamoDB tables that you specify in your event selectors for your trail to log data events. Data events provide information about the resource operations performed on or within a resource itself. These are also known as data plane operations. You can specify up to 250 data resources for a trail.
The total number of allowed data resources is 250. This number can be distributed between 1 and 5 event selectors, but the total cannot exceed 250 across all selectors.
If you are using advanced event selectors, the maximum total number of values for all conditions, across all advanced event selectors for the trail, is 500.
The following example demonstrates how logging works when you configure logging of all data events for an S3 bucket named
bucket-1
. In this example, the CloudTrail user specified an empty prefix, and the option to log bothRead
andWrite
data events.-
A user uploads an image file to
bucket-1
. -
The
PutObject
API operation is an Amazon S3 object-level API. It is recorded as a data event in CloudTrail. Because the CloudTrail user specified an S3 bucket with an empty prefix, events that occur on any object in that bucket are logged. The trail processes and logs the event. -
A user uploads an object to an Amazon S3 bucket named
arn:aws:s3:::bucket-2
. -
The
PutObject
API operation occurred for an object in an S3 bucket that the CloudTrail user didn't specify for the trail. The trail doesn’t log the event.
The following example demonstrates how logging works when you configure logging of AWS Lambda data events for a Lambda function named MyLambdaFunction, but not for all AWS Lambda functions.
-
A user runs a script that includes a call to the MyLambdaFunction function and the MyOtherLambdaFunction function.
-
The
Invoke
API operation on MyLambdaFunction is an AWS Lambda API. It is recorded as a data event in CloudTrail. Because the CloudTrail user specified logging data events for MyLambdaFunction, any invocations of that function are logged. The trail processes and logs the event. -
The
Invoke
API operation on MyOtherLambdaFunction is an AWS Lambda API. Because the CloudTrail user did not specify logging data events for all Lambda functions, theInvoke
operation for MyOtherLambdaFunction does not match the function specified for the trail. The trail doesn’t log the event.
-
- Delete
Trail Request The request that specifies the name of a trail to delete.
- Delete
Trail Response Returns the objects or data listed below if successful. Otherwise, returns an error.
- Describe
Trails Request Returns information about the trail.
- Describe
Trails Response Returns the objects or data listed below if successful. Otherwise, returns an error.
- Event
Contains information about an event that was returned by a lookup request. The result includes a representation of a CloudTrail event.
- Event
Selector Use event selectors to further specify the management and data event settings for your trail. By default, trails created without specific event selectors will be configured to log all read and write management events, and no data events. When an event occurs in your account, CloudTrail evaluates the event selector for all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event.
You can configure up to five event selectors for a trail.
You cannot apply both event selectors and advanced event selectors to a trail.
- GetEvent
Selectors Request - GetEvent
Selectors Response - GetInsight
Selectors Request - GetInsight
Selectors Response - GetTrail
Request - GetTrail
Response - GetTrail
Status Request The name of a trail about which you want the current status.
- GetTrail
Status Response Returns the objects or data listed below if successful. Otherwise, returns an error.
- Insight
Selector A JSON string that contains a list of insight types that are logged on a trail.
- List
Public Keys Request Requests the public keys for a specified time range.
- List
Public Keys Response Returns the objects or data listed below if successful. Otherwise, returns an error.
- List
Tags Request Specifies a list of trail tags to return.
- List
Tags Response Returns the objects or data listed below if successful. Otherwise, returns an error.
- List
Trails Request - List
Trails Response - Lookup
Attribute Specifies an attribute and value that filter the events returned.
- Lookup
Events Request Contains a request for LookupEvents.
- Lookup
Events Response Contains a response to a LookupEvents action.
- Public
Key Contains information about a returned public key.
- PutEvent
Selectors Request - PutEvent
Selectors Response - PutInsight
Selectors Request - PutInsight
Selectors Response - Remove
Tags Request Specifies the tags to remove from a trail.
- Remove
Tags Response Returns the objects or data listed below if successful. Otherwise, returns an error.
- Resource
Specifies the type and name of a resource referenced by an event.
- Resource
Tag A resource tag.
- Start
Logging Request The request to CloudTrail to start logging AWS API calls for an account.
- Start
Logging Response Returns the objects or data listed below if successful. Otherwise, returns an error.
- Stop
Logging Request Passes the request to CloudTrail to stop logging AWS API calls for the specified account.
- Stop
Logging Response Returns the objects or data listed below if successful. Otherwise, returns an error.
- Tag
A custom key-value pair associated with a resource such as a CloudTrail trail.
- Trail
The settings for a trail.
- Trail
Info Information about a CloudTrail trail, including the trail's name, home region, and Amazon Resource Name (ARN).
- Update
Trail Request Specifies settings to update for the trail.
- Update
Trail Response Returns the objects or data listed below if successful. Otherwise, returns an error.
Enums§
- AddTags
Error - Errors returned by AddTags
- Create
Trail Error - Errors returned by CreateTrail
- Delete
Trail Error - Errors returned by DeleteTrail
- Describe
Trails Error - Errors returned by DescribeTrails
- GetEvent
Selectors Error - Errors returned by GetEventSelectors
- GetInsight
Selectors Error - Errors returned by GetInsightSelectors
- GetTrail
Error - Errors returned by GetTrail
- GetTrail
Status Error - Errors returned by GetTrailStatus
- List
Public Keys Error - Errors returned by ListPublicKeys
- List
Tags Error - Errors returned by ListTags
- List
Trails Error - Errors returned by ListTrails
- Lookup
Events Error - Errors returned by LookupEvents
- PutEvent
Selectors Error - Errors returned by PutEventSelectors
- PutInsight
Selectors Error - Errors returned by PutInsightSelectors
- Remove
Tags Error - Errors returned by RemoveTags
- Start
Logging Error - Errors returned by StartLogging
- Stop
Logging Error - Errors returned by StopLogging
- Update
Trail Error - Errors returned by UpdateTrail
Traits§
- Cloud
Trail - Trait representing the capabilities of the CloudTrail API. CloudTrail clients implement this trait.