The AWS Access Key Id you provided does not exist in our records

0 votes

I am getting invalid aws access key id error . The code is below

const s3 = new AWS.S3({
  accessKeyId: process.env.AWS_ACCESS_KEY_ID, // your AWS access id
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, // your AWS access key
});

// actual function for uploading file
async function uploadFile(file) {
  const params = {
    Bucket: process.env.AWS_BUCKET, // bucket you want to upload to
    Key: `fileupload/scanskill-${Date.now()}-${file.name}`, // put all image to fileupload folder with name scanskill-${Date.now()}${file.name}`
    Body: file.data,
    ACL: "public-read",
  };
  const data = await s3.upload(params).promise();
  return data.Location; // returns the url location
}

The problem is not with the code because i tried nearly half a dozen different tutorials and always the same error . I have the updated credentials in the .env file also on the /.aws/credentials file . However i keep getting the same error . i have looked for solutions online which say create another IAM but i cannot do so as i am using a AWS educate account for my uni project . any solutions will be appreciated.

for it to work but the same error keeps popping up.

Dec 22, 2022 in AWS by Tejashwini
• 3,820 points
1,883 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In AWS

+1 vote
3 answers
+3 votes
3 answers
0 votes
1 answer

DynamoDB : The provided key element does not match the schema

The following applies to the Node.js AWS ...READ MORE

answered Nov 13, 2018 in AWS by Priyaj
• 58,020 points
32,393 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,020 points
5,957 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,020 points
5,204 views
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,820 points
2,867 views
0 votes
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP