Skip to content

StartQuery

Source: src/AWS/CloudTrail/StartQuery.ts

Runtime binding for cloudtrail:StartQuery.

Starts a CloudTrail Lake SQL query against the bound EventDataStore and returns the QueryId to poll with DescribeQuery / GetQueryResults. Provide the implementation with Effect.provide(AWS.CloudTrail.StartQueryHttp).

// init — bind the operation to the event data store
const startQuery = yield* AWS.CloudTrail.StartQuery(store);
// runtime — the callback receives the store's ID for the FROM clause
const { QueryId } = yield* startQuery({
QueryStatement: (id) =>
`SELECT eventID, eventName FROM ${id} LIMIT 10`,
});