Skip to content

GenerateQuery

Source: src/AWS/CloudTrail/GenerateQuery.ts

Runtime binding for cloudtrail:GenerateQuery.

Generates a CloudTrail Lake SQL statement from a natural-language prompt against the bound EventDataStore (the store list is injected from the binding). Provide the implementation with Effect.provide(AWS.CloudTrail.GenerateQueryHttp).

// init — bind the operation to the event data store
const generateQuery = yield* AWS.CloudTrail.GenerateQuery(store);
// runtime
const result = yield* generateQuery({
Prompt: "What are my top errors in the past month?",
});
console.log(result.QueryStatement);