Skip to content

start_query

Operation

start_query

start_query(request: StartQueryInput | StartQueryInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[StartQueryInputDict]) -> StartQueryOutput
Warning

CloudTrail Lake will no longer be open to new customers starting May 31, 2026. If you would like to use CloudTrail Lake, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see CloudTrail Lake availability change.

Starts a CloudTrail Lake query. Use the QueryStatement parameter to provide your SQL query, enclosed in single quotation marks. Use the optional DeliveryS3Uri parameter to deliver the query results to an S3 bucket.

StartQuery requires you specify either the QueryStatement parameter, or a QueryAlias and any QueryParameters. In the current release, the QueryAlias and QueryParameters parameters are used only for the queries that populate the CloudTrail Lake dashboards.

Parameters:

Name Type Description Default
request StartQueryInput | StartQueryInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[StartQueryInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
StartQueryOutput

An instance of StartQueryOutput.

start_query async

start_query(request: StartQueryInput | StartQueryInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[StartQueryInputDict]) -> StartQueryOutput
Warning

CloudTrail Lake will no longer be open to new customers starting May 31, 2026. If you would like to use CloudTrail Lake, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see CloudTrail Lake availability change.

Starts a CloudTrail Lake query. Use the QueryStatement parameter to provide your SQL query, enclosed in single quotation marks. Use the optional DeliveryS3Uri parameter to deliver the query results to an S3 bucket.

StartQuery requires you specify either the QueryStatement parameter, or a QueryAlias and any QueryParameters. In the current release, the QueryAlias and QueryParameters parameters are used only for the queries that populate the CloudTrail Lake dashboards.

Parameters:

Name Type Description Default
request StartQueryInput | StartQueryInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[StartQueryInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
StartQueryOutput

An instance of StartQueryOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

StartQueryInputDict

Bases: TypedDict

Dictionary form of StartQueryInput.

Attributes

delivery_s3_uri instance-attribute
delivery_s3_uri: str | None

The URI for the S3 bucket where CloudTrail delivers the query results.

event_data_store_owner_account_id instance-attribute
event_data_store_owner_account_id: str | None

The account ID of the event data store owner.

query_alias instance-attribute
query_alias: str | None

The alias that identifies a query template.

query_parameters instance-attribute
query_parameters: Sequence[str] | None

The query parameters for the specified QueryAlias.

query_statement instance-attribute
query_statement: str | None

The SQL code of your query.

StartQueryInput dataclass

Bases: _SerdeShape

Dataclass for StartQueryInput structure.

Attributes

delivery_s3_uri class-attribute instance-attribute
delivery_s3_uri: str | None = ...

The URI for the S3 bucket where CloudTrail delivers the query results.

event_data_store_owner_account_id class-attribute instance-attribute
event_data_store_owner_account_id: str | None = ...

The account ID of the event data store owner.

query_alias class-attribute instance-attribute
query_alias: str | None = ...

The alias that identifies a query template.

query_parameters class-attribute instance-attribute
query_parameters: list[str] | None = ...

The query parameters for the specified QueryAlias.

query_statement class-attribute instance-attribute
query_statement: str | None = ...

The SQL code of your query.

Output

StartQueryOutput dataclass

Bases: _SerdeShape

Dataclass for StartQueryOutput structure.

Attributes

event_data_store_owner_account_id class-attribute instance-attribute
event_data_store_owner_account_id: str | None = ...

The account ID of the event data store owner.

query_id class-attribute instance-attribute
query_id: str | None = ...

The ID of the started query.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.