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
181 stars 70 forks source link

Not detecting ec2 instance role #59

Closed chammaaomar closed 3 years ago

chammaaomar commented 3 years ago

Hi there, Thank you for working on this package. It's a nice abstraction around the AWS-SDK Athena methods.

One thing that's not working for me though is when I deploy this on an EC2 Instance that has a role with the proper Athena and S3 permissions, I get the TypeError: "AWS object not present or incorrect in the constructor". Based on the source code, this seems to correspond to

let aws = init.aws.config.credentials.accessKeyId

throwing some null pointer exception. The EC2 instance does have the correct role, so why is this throwing? And how can it be fixed?

When testing locally / CI it wasn't throwing this exception because it was reading the credentials directly from a json file through aws.config.loadFromPath('config.json'), but in production environment we don't do that and just rely on instance roles. So, do you know why this isn't working? Thank you!

chammaaomar commented 3 years ago

I saw there's an existing issue with what looks like a resolution, so I closed it. Thanks!