Discover Resource Events

Discover events for a specific resource.

Source codePermissions

If created_before and created_after are not supplied, events are fetched for the last 90 days.

This action will fetch all events against a resource in the specified time period and then filter for supplied events.
If you are looking to find a specific event, use Discover Events instead.

For a list of event names, see Event Names.

Usage

Input

Parameter Description Type Required Default Value
resource_id Search events affecting this resource string Yes None
events Search for specific events list(string) No None
created_after Search for events created after this time. (YYYY/MM/DD) string No None
created_before Search for events created before this time. (YYYY/MM/DD) string No None
region Region for operation. Leave blank for session default string No Session Default
debug Increase log verbosity bool No False
silent Decrease log verbosity bool No False
output Output format
table
string No None
session Established session object No None

Output

Returns a list of objects containing discovered events:

[
    {
        'UserName': 'foo',
        'EventTime': '2021-01-01T00:00:00Z',
        'EventName': 'DetachVolume',
        'Resources': '["vol-1234567890abcdef0", "i-1234567890abcdef0"]'
    }
]

Examples

Discover any events against ‘vol-1234567890abcdef0’ created in the last 90 days in eu-west-2:

aaws cloudtrail discover_resource_events --resource_id vol-1234567890abcdef0 --region eu-west-2

Discover any ‘DetachVolume’ events against ‘vol-1234567890abcdef0’ in eu-west-2 between Jan 5, 2024 and Jan 10, 2024:

aaws cloudtrail discover_resource_events --resource_id vol-1234567890abcdef0 --events DetachVolume --created_before 2024/01/10 --created_after 2024/01/05 --region eu-west-2