My code to get Athena Query is
self.athenaDataSource = "AwsCatalog"
self.athenaDB = "prod_myapp_app"
self.athenaResultBucket = "s3://s3-athena-prod-results/"
and here i show I create client and call .start_query_execution
clientAthena = boto3.client('athena', region_name=awsRegion)
athenaQueryExecResp = clientAthena.start_query_execution(
QueryString=self.athenaQuery,
QueryExecutionContext={ 'Database': self.athenaDB },
ResultConfiguration={'OutputLocation': self.athenaResultBucket }
)
print("athenaQueryExecResp= "+str(athenaQueryExecResp))
I get this error
botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the StartQueryExecution operation: The security token included in the request is invalid.
The thing is it means I am not passing security which si correct but how do I pass the credentials. I checked https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/athena.html#Athena.Client.start_query_execution it never mentions anythign about passing credentials security access and token