Skip to main content

events

Creates, updates, deletes, gets or lists an events resource.

Overview

Nameevents
TypeResource
Idaws.cloudtrail.events

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
access_key_idstringThe Amazon Web Services access key ID that was used to sign the request. If the request was made with temporary security credentials, this is the access key ID of the temporary credentials.
cloud_trail_eventstringA JSON string that contains a representation of the event returned.
event_idstringThe CloudTrail ID of the event returned.
event_namestringThe name of the event returned.
event_sourcestringThe Amazon Web Services service to which the request was made.
event_timestring (date-time)The date and time of the event returned.
read_onlystringInformation about whether the event is a write event or a read event.
resourcesarrayA list of resources referenced by the event returned.
usernamestringA user name or role name of the requester that called the API in the event returned.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
lookup_eventsselectregionLooks 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. LookupEvents returns recent Insights events for trails that enable Insights. To view Insights events for an event data store, you can run queries on your Insights event data store, and you can also view the Lake dashboard for Insights. Lookup supports the following attributes for management events: Amazon Web Services access key Event ID Event name Event source Read only Resource name Resource type User name Lookup supports the following attributes for Insights events: Event ID Event name Event source All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results. The rate of lookup requests is limited to two per second, per account, per Region. If this limit is exceeded, a throttling error occurs.
restore_event_data_storeexecregion, EventDataStoreRestores a deleted event data store specified by EventDataStore, which accepts an event data store ARN. You can only restore a deleted event data store within the seven-day wait period after deletion. Restoring an event data store can take several minutes, depending on the size of the event data store.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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. LookupEvents returns recent Insights events for trails that enable Insights. To view Insights events for an event data store, you can run queries on your Insights event data store, and you can also view the Lake dashboard for Insights. Lookup supports the following attributes for management events: Amazon Web Services access key Event ID Event name Event source Read only Resource name Resource type User name Lookup supports the following attributes for Insights events: Event ID Event name Event source All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results. The rate of lookup requests is limited to two per second, per account, per Region. If this limit is exceeded, a throttling error occurs.

SELECT
access_key_id,
cloud_trail_event,
event_id,
event_name,
event_source,
event_time,
read_only,
resources,
username
FROM aws.cloudtrail.events
WHERE region = '{{ region }}' -- required
;

Lifecycle Methods

Restores a deleted event data store specified by EventDataStore, which accepts an event data store ARN. You can only restore a deleted event data store within the seven-day wait period after deletion. Restoring an event data store can take several minutes, depending on the size of the event data store.

EXEC aws.cloudtrail.events.restore_event_data_store
@region='{{ region }}' --required
@@json=
'{
"EventDataStore": "{{ EventDataStore }}"
}'
;