CloudTrail class

This is the CloudTrail API Reference. It provides descriptions of actions, data types, common parameters, and common errors for CloudTrail.

Constructors

CloudTrail({required String region, AwsClientCredentials? credentials, AwsClientCredentialsProvider? credentialsProvider, Client? client, String? endpointUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addTags({required String resourceId, List<Tag>? tagsList}) Future<void>
Adds one or more tags to a trail, up to a limit of 50. Overwrites an existing tag's value when a new value is specified for an existing tag key. Tag key names must be unique for a trail; you cannot have two keys with the same name but different values. If you specify a key without a value, the tag will be created with the specified key and a value of null. You can tag a trail that applies to all AWS Regions only from the Region in which the trail was created (also known as its home region).
close() → void
Closes the internal HTTP client if none was provided at creation. If a client was passed as a constructor argument, this becomes a noop.
createTrail({required String name, required String s3BucketName, String? cloudWatchLogsLogGroupArn, String? cloudWatchLogsRoleArn, bool? enableLogFileValidation, bool? includeGlobalServiceEvents, bool? isMultiRegionTrail, bool? isOrganizationTrail, String? kmsKeyId, String? s3KeyPrefix, String? snsTopicName, List<Tag>? tagsList}) Future<CreateTrailResponse>
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
deleteTrail({required String name}) Future<void>
Deletes a trail. This operation must be called from the region in which the trail was created. DeleteTrail cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.
describeTrails({bool? includeShadowTrails, List<String>? trailNameList}) Future<DescribeTrailsResponse>
Retrieves settings for one or more trails associated with the current region for your account.
getEventSelectors({required String trailName}) Future<GetEventSelectorsResponse>
Describes the settings for the event selectors that you configured for your trail. The information returned for your event selectors includes the following:
getInsightSelectors({required String trailName}) Future<GetInsightSelectorsResponse>
Describes the settings for the Insights event selectors that you configured for your trail. GetInsightSelectors shows if CloudTrail Insights event logging is enabled on the trail, and if it is, which insight types are enabled. If you run GetInsightSelectors on a trail that does not have Insights events enabled, the operation throws the exception InsightNotEnabledException
getTrail({required String name}) Future<GetTrailResponse>
Returns settings information for a specified trail.
getTrailStatus({required String name}) Future<GetTrailStatusResponse>
Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop logging times for each trail. This operation returns trail status from a single region. To return trail status from all regions, you must call the operation on each region.
listPublicKeys({DateTime? endTime, String? nextToken, DateTime? startTime}) Future<ListPublicKeysResponse>
Returns all public keys whose private keys were used to sign the digest files within the specified time range. The public key is needed to validate digest files that were signed with its corresponding private key.
listTags({required List<String> resourceIdList, String? nextToken}) Future<ListTagsResponse>
Lists the tags for the trail in the current region.
listTrails({String? nextToken}) Future<ListTrailsResponse>
Lists trails that are in the current account.
lookupEvents({DateTime? endTime, EventCategory? eventCategory, List<LookupAttribute>? lookupAttributes, int? maxResults, String? nextToken, DateTime? startTime}) Future<LookupEventsResponse>
Looks up management events or CloudTrail Insights events that are captured by CloudTrail. You can look up events that occurred in a region within the last 90 days. Lookup supports the following attributes for management events:
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putEventSelectors({required String trailName, List<AdvancedEventSelector>? advancedEventSelectors, List<EventSelector>? eventSelectors}) Future<PutEventSelectorsResponse>
Configures an event selector or advanced event selectors for your trail. Use event selectors or advanced event selectors to specify management and data event settings for your trail. By default, trails created without specific event selectors are configured to log all read and write management events, and no data events.
putInsightSelectors({required List<InsightSelector> insightSelectors, required String trailName}) Future<PutInsightSelectorsResponse>
Lets you enable Insights event logging by specifying the Insights selectors that you want to enable on an existing trail. You also use PutInsightSelectors to turn off Insights event logging, by passing an empty list of insight types. In this release, only ApiCallRateInsight is supported as an Insights selector.
removeTags({required String resourceId, List<Tag>? tagsList}) Future<void>
Removes the specified tags from a trail.
startLogging({required String name}) Future<void>
Starts the recording of AWS API calls and log file delivery for a trail. For a trail that is enabled in all regions, this operation must be called from the region in which the trail was created. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.
stopLogging({required String name}) Future<void>
Suspends the recording of AWS API calls and log file delivery for the specified trail. Under most circumstances, there is no need to use this action. You can update a trail without stopping it first. This action is the only way to stop recording. For a trail enabled in all regions, this operation must be called from the region in which the trail was created, or an InvalidHomeRegionException will occur. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail enabled in all regions.
toString() String
A string representation of this object.
inherited
updateTrail({required String name, String? cloudWatchLogsLogGroupArn, String? cloudWatchLogsRoleArn, bool? enableLogFileValidation, bool? includeGlobalServiceEvents, bool? isMultiRegionTrail, bool? isOrganizationTrail, String? kmsKeyId, String? s3BucketName, String? s3KeyPrefix, String? snsTopicName}) Future<UpdateTrailResponse>
Updates the settings that specify delivery of log files. Changes to a trail do not require stopping the CloudTrail service. Use this action to designate an existing bucket for log delivery. If the existing bucket has previously been a target for CloudTrail log files, an IAM policy exists for the bucket. UpdateTrail must be called from the region in which the trail was created; otherwise, an InvalidHomeRegionException is thrown.

Operators

operator ==(Object other) bool
The equality operator.
inherited