| 1 | import type * as cloudtrail from "@distilled.cloud/aws/cloudtrail"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `cloudtrail:LookupEvents`. |
| 7 | * |
| 8 | * An account-level operation (no resource argument) that searches the last |
| 9 | * 90 days of management events recorded in the region — the classic "who did |
| 10 | * what" audit read, available without any trail or event data store. Provide |
| 11 | * the implementation with `Effect.provide(AWS.CloudTrail.LookupEventsHttp)`. |
| 12 | * ### Reading Event History |
| 13 | * **Example:** Look Up Recent Events |
| 14 | * ```typescript |
| 15 | * // init — account-level binding takes no resource |
| 16 | * const lookupEvents = yield* AWS.CloudTrail.LookupEvents(); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const result = yield* lookupEvents({ |
| 20 | * LookupAttributes: [ |
| 21 | * { AttributeKey: "EventName", AttributeValue: "CreateBucket" }, |
| 22 | * ], |
| 23 | * MaxResults: 10, |
| 24 | * }); |
| 25 | * console.log(result.Events?.map((e) => e.EventName)); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface LookupEvents extends Binding.Service< |
| 31 | LookupEvents, |
| 32 | "AWS.CloudTrail.LookupEvents", |
| 33 | () => Effect.Effect< |
| 34 | ( |
| 35 | request?: cloudtrail.LookupEventsRequest, |
| 36 | ) => Effect.Effect< |
| 37 | cloudtrail.LookupEventsResponse, |
| 38 | cloudtrail.LookupEventsError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const LookupEvents = Binding.Service<LookupEvents>( |
| 43 | "AWS.CloudTrail.LookupEvents", |
| 44 | ); |