Closed skew202 closed 8 months ago
Hi @skew202 - thanks for reaching out and apologies for not responding it sooner.
I was able to reproduce it and found out that you'd need to import SignatureV4 and use fromEnv method to provide credentials as shown below. The reason behind, I think, is because JS v3 is opt-in for the use of Sigv4 due to a large optional dependency on the aws-crt
node bindings package. It doesn't automatically include nor dynamically import this package due to its size negatively affecting customer who don't need it.
import { S3Client, ListBucketsCommand } from "@aws-sdk/client-s3";
import { SignatureV4 } from "@smithy/signature-v4";
import { fromEnv } from "@aws-sdk/credential-providers";
const signatureV4 = new SignatureV4({
credentials: fromEnv()
})
const s3Client = new S3Client({
region: process.env.AWS_REGION
});
const listBuckets = new ListBucketsCommand({});
const response = await s3Client.send(listBuckets)
Hope that makes sense and if you have any further questions, please let me know! Best, John
This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.
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.
Checkboxes for prior research
Describe the bug
When creating an S3Client with the aws-sdk the initialisation failes for UA_APP_ID_ENV_NAME in
@smithy/node-config-provider
Expected Behavior
A successfully initialized S3Client using the variables available in the
process.env
SDK version number
3.470.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v18.17.0
Reproduction Steps
.env
.index.js
Observed Behavior
Expected Behavior
A successfully initialized S3Client using the variables available in the
process.env
Possible Solution
No response
Additional Information/Context
No response