-
Notifications
You must be signed in to change notification settings - Fork 634
Closed
Labels
bugThis issue is a bug.This issue is a bug.closed-for-stalenessp2This is a standard priority issueThis is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
const REGION = "us-east-2";
const config = {
region: REGION,
}
const s3config = {
region: PUBLIC_AWS_REGION,
credentials:{
accessKeyId: "exampleacessid",
secretAccessKey: "examplesecretid"
}
}
const s3Client = new S3Client(config);
export const retrieveBucketObjList = async (bucket) => {
const command = new ListObjectsV2Command({Bucket: bucket});
try{
const bucketObjs = await s3Client.send(command);
return bucketObjs?.Contents;
}catch(error){
return {error:error.message};
}
}
export const retrieveBucketObj = async (bucket, key) => {
const command = new GetObjectCommand({Bucket: bucket, Key: key});
try{
const object = await s3Client.send(command);
return object;
}catch(error){
return {error:error.message}
}
}
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/client-s3 3.721.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.12.0
Reproduction Steps
- Install aws/client-s3 sdk
- Run this code `given```
Observed Behavior
GetObjectCommand not working with IAM role policy throwing error Credential is missing while ListObjectsv2Command does not throw that GetObjectCommand properly work when i give s3config with hardcoded access and secret access keys it works perfectly
Expected Behavior
GetObjectCommand should work with IAM role provided secret and access keys as ListObjectsV2Command is working properly with IAM roles and permission for s3 bucket in IAM role and even bucket policy is properly configured checked that as well
Possible Solution
No response
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.closed-for-stalenessp2This is a standard priority issueThis is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.