Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I pass workgroup info to Athena startQueryExecution method in Boto3

I am seeing the below error when I try to pass WorkGroup info in the format listed below using my boto3 code in AWS Lambda -

"errorMessage": "Parameter validation failed:\nUnknown parameter in input: \"WorkGroup\", must be one of: QueryString, ClientRequestToken, QueryExecutionContext, ResultConfiguration",

query_id = client.start_query_execution(
    QueryString=query_string,
    QueryExecutionContext={
        'Database': 'sample_db'
    },
    ResultConfiguration={
        'OutputLocation': 's3://sample_db/output/'
    },
    WorkGroup='workgroup1'
)['QueryExecutionId']

As per boto3 documentation , this is something that can be passed - https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/athena.html#Athena.Client.start_query_execution

like image 844
Punter Vicky Avatar asked Oct 26 '25 06:10

Punter Vicky


1 Answers

Follow-up answer from the discussion below the question:

The bundled version of boto3 in the Lambda execution environment is not up to date with the latest boto3 release.

You can make a newer version available either by includin it in the deployment package or adding it as a Lambda Layer.

like image 133
Milan Cermak Avatar answered Oct 28 '25 20:10

Milan Cermak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!