Skip to content

LookupEvents

Source: src/AWS/CloudTrail/LookupEvents.ts

Runtime binding for cloudtrail:LookupEvents.

An account-level operation (no resource argument) that searches the last 90 days of management events recorded in the region — the classic “who did what” audit read, available without any trail or event data store. Provide the implementation with Effect.provide(AWS.CloudTrail.LookupEventsHttp).

// init — account-level binding takes no resource
const lookupEvents = yield* AWS.CloudTrail.LookupEvents();
// runtime
const result = yield* lookupEvents({
LookupAttributes: [
{ AttributeKey: "EventName", AttributeValue: "CreateBucket" },
],
MaxResults: 10,
});
console.log(result.Events?.map((e) => e.EventName));