AWS.S3 reading from ~/.aws/credentials instead of config object
See original GitHub issueconst AWS = require('aws-sdk');
const config = {
accessKeyId: 'xxxx',
secretAcessKey: 'xxxx',
};
const s3 = new AWS.S3(config);
I noticed that the sdk is completely ignoring config
and is instead reading from ~/.aws/credentials
.
If I remove ~/.aws/credentials
, then s3.upload()
etc will fail with
CredentialsError: Missing credentials in config Could not load credentials from any providers
even though the credentials are provided via the config
object in JS.
Environment
OS: macOS High Sierra 10.13.5 / Ubuntu 18.04.1 LTS Node: 8.12.0 Yarn: 1.9.4 aws-sdk: “^2.270.1”
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Using the AWS credentials file and credential Profiles
If you use different credentials for different tools or applications, you can use profiles to configure multiple access keys in the same configuration...
Read more >Working with AWS Credentials - AWS SDK for Java 1.x
You can create a credentials file by using the aws configure command provided by the AWS CLI, or you can create it by...
Read more >Configuration and credential file settings - AWS Documentation
You can keep all of your profile settings in a single file as the AWS CLI can read credentials from the config file....
Read more >Performing Operations on Amazon S3 Objects
How to list, upload, download, copy, rename, move or delete objects in an Amazon S3 bucket using the AWS SDK for Java.
Read more >Making requests using AWS account or IAM user credentials
The easiest way to configure credentials for your AWS SDKs is to use an AWS credentials file. If you use the AWS Command...
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
Figured out the problem…had a typo
secretAcessKey
instead ofsecretAccessKey
.This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.