AWS CloudTrail

App · 20 actions

Inspect CloudTrail event history, trails, event data stores, queries and imports.

Actions

ActionWhat it does
Describe queryGet the details of a CloudTrail Lake query by its ID or alias, including its SQL statement, status, run time and how many events it scanned.
Describe trailsGet the settings of the trails you name, or of every trail in the region, including the S3 bucket, log file validation and whether each trail is multi-region.
Get channelGet one CloudTrail Lake channel by its name or ARN, including its source, destinations and ingestion status.
Get event configurationGet the event configuration of a trail or event data store, such as the maximum event size it accepts and any context keys it adds.
Get event data storeGet one CloudTrail Lake event data store by its name or ARN, including its retention period, status and advanced event selectors.
Get event selectorsGet the event selectors of a trail by its name or ARN, showing which management and data events it records.
Get importGet one CloudTrail Lake import by its ID, including its source S3 location, destinations, status and how many events it has copied.
Get insight selectorsGet the Insights types, such as unusual API call rates, that a trail or event data store is set to detect.
Get query resultsGet the rows returned by a finished CloudTrail Lake query, by its query ID, along with the query's status and statistics.
Get resource policyGet the resource-based policy attached to a CloudTrail Lake channel or event data store, by its ARN.
Get trailGet one trail's settings by its name or ARN, such as its S3 bucket, CloudWatch Logs group and whether it covers all regions.
Get trail statusGet whether a trail is logging, by its name or ARN, with the times of its last delivery to S3 and any recent delivery errors.
List channelsList the CloudTrail Lake channels that bring events in from outside AWS, with each channel's name and ARN.
List event data storesList the CloudTrail Lake event data stores in your account, with each one's name, ARN and status.
List import failuresList the failures of a CloudTrail Lake import, by its import ID, with the S3 location and error message of each failed file.
List importsList the imports of trail events into CloudTrail Lake, optionally filtered by destination event data store and import status.
List queriesList the CloudTrail Lake queries run against an event data store, optionally filtered by time range and query status.
List tagsGet the tags on the trails, event data stores or channels you name by ARN.
List trailsList the trails in your account and region, with each trail's name, ARN and home region.
Lookup eventsSearch the management and Insights events CloudTrail recorded in the last 90 days, optionally filtered by one attribute such as user name or event name and by a time range.

Describe query

Get the details of a CloudTrail Lake query by its ID or alias, including its SQL statement, status, run time and how many events it scanned.

Inputs

Event data storeevent_data_storetext
Event data store.
Queryquery_idtext
Query id.
Query aliasquery_aliastext
Query alias.
Refresh idrefresh_idtext
Refresh id.
Event data store owner account idevent_data_store_owner_account_idtext
Event data store owner account id.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "DeliveryS3Uri": "example",
    "DeliveryStatus": "SUCCESS",
    "ErrorMessage": "example",
    "EventDataStoreOwnerAccountId": "example",
    "Prompt": "example",
    "QueryId": "example",
    "QueryStatistics": {
      "BytesScanned": 1,
      "CreationTime": "example",
      "EventsMatched": 1,
      "EventsScanned": 1,
      "ExecutionTimeInMillis": 1
    },
    "QueryStatus": "QUEUED",
    "QueryString": "example"
  }
}

Describe trails

Get the settings of the trails you name, or of every trail in the region, including the S3 bucket, log file validation and whether each trail is multi-region.

Inputs

Trail name listtrail_name_listlist
Trail name list.
Include shadow trailsinclude_shadow_trailstrue/false
Include shadow trails.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "trailList": []
  }
}

Get channel

Get one CloudTrail Lake channel by its name or ARN, including its source, destinations and ingestion status.

Inputs

ChannelchanneltextRequired
Channel.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "ChannelArn": "example",
    "Destinations": [],
    "IngestionStatus": {
      "LatestIngestionAttemptEventID": "example",
      "LatestIngestionAttemptTime": "example",
      "LatestIngestionErrorCode": "example",
      "LatestIngestionSuccessEventID": "example",
      "LatestIngestionSuccessTime": "example"
    },
    "Name": "example",
    "Source": "example",
    "SourceConfig": {
      "AdvancedEventSelectors": [],
      "ApplyToAllRegions": false
    }
  }
}

Get event configuration

Get the event configuration of a trail or event data store, such as the maximum event size it accepts and any context keys it adds.

Inputs

Trail nametrail_nametext
Trail name.
Event data storeevent_data_storetext
Event data store.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "AggregationConfigurations": [],
    "ContextKeySelectors": [],
    "EventDataStoreArn": "example",
    "MaxEventSize": "Standard",
    "TrailARN": "example"
  }
}

Get event data store

Get one CloudTrail Lake event data store by its name or ARN, including its retention period, status and advanced event selectors.

Inputs

Event data storeevent_data_storetextRequired
Event data store.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "AdvancedEventSelectors": [],
    "BillingMode": "EXTENDABLE_RETENTION_PRICING",
    "CreatedTimestamp": "example",
    "EventDataStoreArn": "example",
    "FederationRoleArn": "example",
    "FederationStatus": "ENABLING",
    "KmsKeyId": "example",
    "MultiRegionEnabled": false,
    "Name": "example",
    "OrganizationEnabled": false,
    "PartitionKeys": [],
    "RetentionPeriod": 1,
    "Status": "CREATED",
    "TerminationProtectionEnabled": false,
    "UpdatedTimestamp": "example"
  }
}

Get event selectors

Get the event selectors of a trail by its name or ARN, showing which management and data events it records.

Inputs

Trail nametrail_nametextRequired
Trail name.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "AdvancedEventSelectors": [],
    "EventSelectors": [],
    "TrailARN": "example"
  }
}

Get import

Get one CloudTrail Lake import by its ID, including its source S3 location, destinations, status and how many events it has copied.

Inputs

Importimport_idtextRequired
Import id.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "CreatedTimestamp": "example",
    "Destinations": [],
    "EndEventTime": "example",
    "ImportId": "example",
    "ImportSource": {
      "S3": {
        "S3BucketAccessRoleArn": "example",
        "S3BucketRegion": "example",
        "S3LocationUri": "example"
      }
    },
    "ImportStatistics": {
      "EventsCompleted": 1,
      "FailedEntries": 1,
      "FilesCompleted": 1,
      "PrefixesCompleted": 1,
      "PrefixesFound": 1
    },
    "ImportStatus": "INITIALIZING",
    "StartEventTime": "example",
    "UpdatedTimestamp": "example"
  }
}

Get insight selectors

Get the Insights types, such as unusual API call rates, that a trail or event data store is set to detect.

Inputs

Trail nametrail_nametext
Trail name.
Event data storeevent_data_storetext
Event data store.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "EventDataStoreArn": "example",
    "InsightSelectors": [],
    "InsightsDestination": "example",
    "TrailARN": "example"
  }
}

Get query results

Get the rows returned by a finished CloudTrail Lake query, by its query ID, along with the query's status and statistics.

Inputs

Event data storeevent_data_storetext
Event data store.
Queryquery_idtextRequired
Query id.
Next tokennext_tokentext
Next token.
Max query resultsmax_query_resultsnumber
Max query results.From 1 to 1000.
Event data store owner account idevent_data_store_owner_account_idtext
Event data store owner account id.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "ErrorMessage": "example",
    "NextToken": "example",
    "QueryResultRows": [],
    "QueryStatistics": {
      "BytesScanned": 1,
      "ResultsCount": 1,
      "TotalResultsCount": 1
    },
    "QueryStatus": "QUEUED"
  }
}

Get resource policy

Get the resource-based policy attached to a CloudTrail Lake channel or event data store, by its ARN.

Inputs

Resource arnresource_arntextRequired
Resource arn.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "DelegatedAdminResourcePolicy": "example",
    "ResourceArn": "example",
    "ResourcePolicy": "example"
  }
}

Get trail

Get one trail's settings by its name or ARN, such as its S3 bucket, CloudWatch Logs group and whether it covers all regions.

Inputs

NamenametextRequired
Name.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "Trail": {
      "CloudWatchLogsLogGroupArn": "example",
      "CloudWatchLogsRoleArn": "example",
      "HasCustomEventSelectors": false,
      "HasInsightSelectors": false,
      "HomeRegion": "example",
      "IncludeGlobalServiceEvents": false,
      "IsMultiRegionTrail": false,
      "IsOrganizationTrail": false,
      "KmsKeyId": "example",
      "LogFileValidationEnabled": false,
      "Name": "example",
      "RecursiveLogging": false,
      "S3BucketName": "example",
      "S3KeyPrefix": "example",
      "SnsTopicARN": "example",
      "SnsTopicName": "example",
      "TrailARN": "example"
    }
  }
}

Get trail status

Get whether a trail is logging, by its name or ARN, with the times of its last delivery to S3 and any recent delivery errors.

Inputs

NamenametextRequired
Name.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "IsLogging": false,
    "LatestCloudWatchLogsDeliveryError": "example",
    "LatestCloudWatchLogsDeliveryTime": "example",
    "LatestDeliveryAttemptSucceeded": "example",
    "LatestDeliveryAttemptTime": "example",
    "LatestDeliveryError": "example",
    "LatestDeliveryTime": "example",
    "LatestDigestDeliveryError": "example",
    "LatestDigestDeliveryTime": "example",
    "LatestNotificationAttemptSucceeded": "example",
    "LatestNotificationAttemptTime": "example",
    "LatestNotificationError": "example",
    "LatestNotificationTime": "example",
    "StartLoggingTime": "example",
    "StopLoggingTime": "example",
    "TimeLoggingStarted": "example",
    "TimeLoggingStopped": "example"
  }
}

List channels

List the CloudTrail Lake channels that bring events in from outside AWS, with each channel's name and ARN.

Inputs

Max resultsmax_resultsnumber
Max results.From 1 to 1000.
Next tokennext_tokentext
Next token.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "Channels": [],
    "NextToken": "example"
  }
}

List event data stores

List the CloudTrail Lake event data stores in your account, with each one's name, ARN and status.

Inputs

Next tokennext_tokentext
Next token.
Max resultsmax_resultsnumber
Max results.From 1 to 1000.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "EventDataStores": [],
    "NextToken": "example"
  }
}

List import failures

List the failures of a CloudTrail Lake import, by its import ID, with the S3 location and error message of each failed file.

Inputs

Importimport_idtextRequired
Import id.
Max resultsmax_resultsnumber
Max results.From 1 to 1000.
Next tokennext_tokentext
Next token.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "Failures": [],
    "NextToken": "example"
  }
}

List imports

List the imports of trail events into CloudTrail Lake, optionally filtered by destination event data store and import status.

Inputs

Max resultsmax_resultsnumber
Max results.From 1 to 1000.
Destinationdestinationtext
Destination.
Import statusimport_statustext
Import status.One of: INITIALIZING, IN_PROGRESS (In progress), FAILED, STOPPED, COMPLETED.
Next tokennext_tokentext
Next token.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "Imports": [],
    "NextToken": "example"
  }
}

List queries

List the CloudTrail Lake queries run against an event data store, optionally filtered by time range and query status. Returns each query's ID, status and start time.

Inputs

Event data storeevent_data_storetextRequired
Event data store.
Next tokennext_tokentext
Next token.
Max resultsmax_resultsnumber
Max results.From 1 to 1000.
Start timestart_timedate and time
Start time.
End timeend_timedate and time
End time.
Query statusquery_statustext
Query status.One of: QUEUED, RUNNING, FINISHED, FAILED, CANCELLED, TIMED_OUT (Timed out).

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "NextToken": "example",
    "Queries": []
  }
}

List tags

Get the tags on the trails, event data stores or channels you name by ARN.

Inputs

Resource id listresource_id_listlistRequired
Resource id list.
Next tokennext_tokentext
Next token.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "NextToken": "example",
    "ResourceTagList": []
  }
}

List trails

List the trails in your account and region, with each trail's name, ARN and home region.

Inputs

Next tokennext_tokentext
Next token.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "NextToken": "example",
    "Trails": []
  }
}

Lookup events

Search the management and Insights events CloudTrail recorded in the last 90 days, optionally filtered by one attribute such as user name or event name and by a time range. Returns the matching events, newest first.

Inputs

Lookup attributeslookup_attributeslist
Lookup attributes.
Start timestart_timedate and time
Start time.
End timeend_timedate and time
End time.
Event categoryevent_categorytext
Event category.One of: insight.
Max resultsmax_resultsnumber
Max results.From 1 to 50.
Next tokennext_tokentext
Next token.

Outputs

dataobject
AWS Cloud Trail response data.
Example output
{
  "data": {
    "Events": [],
    "NextToken": "example"
  }
}

On this page