S3Client Instantiation not finding ENV variables #6211
Labels
bug
This issue is a bug.
closed-for-staleness
p3
This is a minor priority issue
response-requested
Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Checkboxes for prior research
Describe the bug
When instantiating the S3Client object on a Nodejs project with an empty configuration object, the S3Client fails to pull AWS credentials stored as env variables despite the documentation stating that the credential provider chain searches in multiple locations for credentials.
I found that instantiating the S3Client object bare like the below line does not fetch credentials properly
const client = new S3Client({});
However, instantiating the S3Client object with the fromEnv() function does result in credentials being fetched properly from env variables.
const client = new S3Client({credentials: fromEnv()});
SDK version number
@aws-sdk/client-s3@3.588.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.11.1
Reproduction Steps
const client = new S3Client({credentials: fromEnv()});
you will need tonpm install @aws-sdk/credential-provider-env
and import fromEnv iin order to resolve fromEnv()Observed Behavior
Running the script results in an invalid credentials error
Expected Behavior
Running the script fetches the specified file
Possible Solution
credential provider chain not searching for env variables first OR is unable to fetch env variables
Additional Information/Context
Running on ARM Mac OS
The text was updated successfully, but these errors were encountered: