ghdna / athena-express

Athena-Express can simplify executing SQL queries in Amazon Athena AND fetching cleaned-up JSON results in the same synchronous or asynchronous request - well suited for web applications.
https://www.npmjs.com/package/athena-express
MIT License
179 stars 70 forks source link

S3 Path specification required if using athena-express on EKS deployment #91

Open roych98 opened 1 year ago

roych98 commented 1 year ago

Hey, so long story short, I have a nodejs application which is deployed on an EKS cluster. All nodes have security policies to be able to access S3 directly without having to have an accessKeyId specified within the AWS Config.

I noticed that if I try to construct an AthenaExpress object without specifying an S3 path, an error is thrown as follows: throw new TypeError( "AWS object not present or incorrect in the constructor" ); From ./lib/helpers.jswithin the athena-express project.

If I do specify and S3 path, everything works flawlessly. So I figured that the problem lies within init.aws.config.credentials.accessKeyId which is most undefined (Because I don't even need to declare an AWS Config anywhere in the code because my code is running within AWS infrastructure and I allow the communication between my EKS nodes and S3), and thus the error.

Willing to share more information if needed. Thanks.

ghdna commented 1 year ago

Right... it assumes accesskeyId is present. I can remove that piece.

roych98 commented 1 year ago

Awesome, thanks. Otherwise the tradeoff would be that if you use an EKS deployment you just have to specify an S3 path.