question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AWS.S3 reading from ~/.aws/credentials instead of config object

See original GitHub issue
const 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:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
riwucommented, Nov 13, 2018

Figured out the problem…had a typo secretAcessKey instead of secretAccessKey.

0reactions
lock[bot]commented, Sep 29, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found