awswrangler.cloudwatch.wait_query(query_id: str, boto3_session: Session | None = None, cloudwatch_query_wait_polling_delay: float = 1.0) Dict[str, Any]

Wait query ends.


This function has arguments which can be configured globally through wr.config or environment variables:

  • cloudwatch_query_wait_polling_delay

Check out the Global Configurations Tutorial for details.

  • query_id (str) – Query ID.

  • boto3_session (boto3.Session(), optional) – Boto3 Session. The default boto3 session will be used if boto3_session receive None.

  • cloudwatch_query_wait_polling_delay (float, default: 0.2 seconds) – Interval in seconds for how often the function will check if the CloudWatch query has completed.


Query result payload.

Return type:

Dict[str, Any]


>>> import awswrangler as wr
>>> query_id = wr.cloudwatch.start_query(
...     log_group_names=["loggroup"],
...     query="fields @timestamp, @message | sort @timestamp desc | limit 5",
... )
... response = wr.cloudwatch.wait_query(query_id=query_id)