Error `AWS object not present or incorrect in the constructor` when using IAM role
See original GitHub issueWhen IAM role is used for EC2/Lambda and s3
options is not passed to the config, athena-express
is not able to create new buckets on its behalf, failing with error AWS object not present or incorrect in the constructor
.
It looks here:
https://github.com/ghdna/athena-express/blob/master/lib/athenaExpress.js#L232
that it expects either s3
option to be set or credentials keys to be passed.
I had IAM role set up with full access to S3 and Athena, though I had to specify S3 location manually to override behavior.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Resolve the IAM Error "AWS was not able to validate the ...
I assumed an AWS Identity and Access Management (IAM) role and my API call returned an error similar to the following:.
Read more >Credentials — AWS SDK for PHP documentation
This provides a strategy for managing credentials for your applications to use, similar to the way that Amazon EC2 instance profiles provide credentials...
Read more >Using IAM Roles to Grant Access to AWS Resources on ...
If the client constructor can't find credentials using the credentials provider chain, it will throw an AmazonClientException. Walkthrough: Using IAM roles for ...
Read more >Upload an object to an Amazon S3 bucket using an AWS SDK
The following code examples show how to upload an object to an S3 bucket. ... "Error unable to read file " << fileName...
Read more >Configuration for the AWS SDK for PHP Version 3
Load credentials from an IAM role. Pass false to use null credentials and not sign requests. $s3 = new Aws\S3\S3Client([ 'version' => 'latest', ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had this error when trying to pass AWS ( caps ) instead of aws. To replicate the issue:
However below worked fine:
After a further investigation, I found the issue and why it’s related only with roles:
This line is the cause.
For all of you having this issue, can you specify a custom s3 output directory for your queries? If so, it won’t fail as the exception is thrown because of the lack of both, the
s3
value in the constructor, and the lack of a valid AWS access key (because you are using arole
/instanceprofile
).