You must orchestrate a sequence of Amazon Athena queries every day; individual queries can run longer than 15 minutes. Which combination of steps is the MOST cost-effective? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Use an AWS Lambda function and the Athena Boto3 client start_query_execution API call to invoke the Athena queries programmatically., Create an AWS Step Functions workflow and add two states. Add the first state before the Lambda function. Configure the second state as a Wait state to periodically check whether the Athena query has finished using the Athena Boto3 get_query_execution API call. Configure the workflow to invoke the next query when the current query has finished running..
Why this is the answer
The combination of AWS Lambda and AWS Step Functions provides a cost-effective and robust solution for orchestrating long-running Athena queries. Lambda functions are ideal for initiating Athena queries using the startqueryexecution API. Since Athena queries can exceed Lambda's 15-minute timeout, Step Functions is used to manage the workflow. A Step Functions workflow can invoke the Lambda function, then use a Wait state and a loop with getqueryexecution to poll for the query's completion without incurring continuous compute costs. This "fan-out" pattern allows for asynchronous execution and avoids Lambda timeouts. AWS Glue Python shell jobs are generally more expensive for simple orchestration tasks, as they provision an entire Spark environment. Using a sleep timer within a Glue Python shell script for polling is inefficient and costly. Amazon MWAA is powerful but often overkill and more expensive for simple daily Athena query orchestration.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed