শুষ্ক লাল মরিচ, যার পৃষ্ঠ কুঁচকানো এবং রঙ গাঢ় লাল।
সাদা পটভূমিতে শুকনো লাল মরিচ।
২০ বছরের অভিজ্ঞতাসম্পন্ন চিলি সস ফ্যাক্টরি, বাইরের ও ভেতরের দৃশ্য।
চিলি ক্ষেত্র যেখানে লেখা আছে: "উৎস রোপণ, গুণমান নিশ্চিত করুন।"
বিভিন্নSo, I'm trying to use the `aws-sdk` in Node.js to interact with S3. I've got a bucket, and I'm trying to upload a file to it. Here's my code:

```javascript
const AWS = require('aws-sdk');
const fs = require('fs');

const s3 = new AWS.S3({
  accessKeyId: 'YOUR_ACCESS_KEY_ID',
  secretAccessKey: 'YOUR_SECRET_ACCESS_KEY',
  region: 'YOUR_REGION'
});

const uploadFile = (fileName) => {
  const fileContent = fs.readFileSync(fileName);

  const params = {
    Bucket: 'YOUR_BUCKET_NAME',
    Key: 'YOUR_OBJECT_KEY', // e.g., 'my-folder/my-file.txt'
    Body: fileContent,
  };

  s3.upload(params, (err, data) => {
    if (err) {
      console.error('Error uploading file:', err);
    } else {
      console.log('File uploaded successfully:', data.Location);
    }
  });
};

// Example usage:
uploadFile('path/to/your/local/file.txt');
```

I've replaced `YOUR_ACCESS_KEY_ID`, `YOUR_SECRET_ACCESS_KEY`, `YOUR_REGION`, `YOUR_BUCKET_NAME`, and `YOUR_OBJECT_KEY` with my actual credentials and details.

However, when I run this, I'm getting an error:

```
Error uploading file: {
  code: 'CredentialsError',
  message: 'Could not load credentials from any providers',
  retryable: false,
  time: 2023-10-27T10:30:00.123Z,
  // ... other properties
}
```

I've double-checked my access key ID and secret access key, and they seem correct. I'm also sure I'm in the right region.

What could be causing this `CredentialsError` and how can I fix it?

Thanks in advance!
আমেরিকান হালাল ফাউন্ডেশন দ্বারা মরিচ পণ্যের জন্য হালাল সার্টিফিকেশন।
একটি সাদা পটভূমির উপর একটি উল্লম্ব লাইনে সাজানো পাঁচটি শুকনো লাল মরিচ।
শুষ্ক লাল মরিচ, যার পৃষ্ঠ কুঁচকানো এবং রঙ গাঢ় লাল।
শুষ্ক লাল মরিচ, যার পৃষ্ঠ কুঁচকানো এবং রঙ গাঢ় লাল।
সাদা পটভূমিতে শুকনো লাল মরিচ।
২০ বছরের অভিজ্ঞতাসম্পন্ন চিলি সস ফ্যাক্টরি, বাইরের ও ভেতরের দৃশ্য।
চিলি ক্ষেত্র যেখানে লেখা আছে: "উৎস রোপণ, গুণমান নিশ্চিত করুন।"
বিভিন্নSo, I'm trying to use the `aws-sdk` in Node.js to interact with S3. I've got a bucket, and I'm trying to upload a file to it. Here's my code:

```javascript
const AWS = require('aws-sdk');
const fs = require('fs');

const s3 = new AWS.S3({
  accessKeyId: 'YOUR_ACCESS_KEY_ID',
  secretAccessKey: 'YOUR_SECRET_ACCESS_KEY',
  region: 'YOUR_REGION'
});

const uploadFile = (fileName) => {
  const fileContent = fs.readFileSync(fileName);

  const params = {
    Bucket: 'YOUR_BUCKET_NAME',
    Key: 'YOUR_OBJECT_KEY', // e.g., 'my-folder/my-file.txt'
    Body: fileContent,
  };

  s3.upload(params, (err, data) => {
    if (err) {
      console.error('Error uploading file:', err);
    } else {
      console.log('File uploaded successfully:', data.Location);
    }
  });
};

// Example usage:
uploadFile('path/to/your/local/file.txt');
```

I've replaced `YOUR_ACCESS_KEY_ID`, `YOUR_SECRET_ACCESS_KEY`, `YOUR_REGION`, `YOUR_BUCKET_NAME`, and `YOUR_OBJECT_KEY` with my actual credentials and details.

However, when I run this, I'm getting an error:

```
Error uploading file: {
  code: 'CredentialsError',
  message: 'Could not load credentials from any providers',
  retryable: false,
  time: 2023-10-27T10:30:00.123Z,
  // ... other properties
}
```

I've double-checked my access key ID and secret access key, and they seem correct. I'm also sure I'm in the right region.

What could be causing this `CredentialsError` and how can I fix it?

Thanks in advance!
আমেরিকান হালাল ফাউন্ডেশন দ্বারা মরিচ পণ্যের জন্য হালাল সার্টিফিকেশন।
একটি সাদা পটভূমির উপর একটি উল্লম্ব লাইনে সাজানো পাঁচটি শুকনো লাল মরিচ।
খাঁটি অর্গানিক শুকনো লাল মরিচ উচ্চ ঝালযুক্ত ঝাল মরিচের বাক্স/ব্যাগ প্যাকেজিং বিভিন্ন ধরণের খাবারের জন্য
সর্বনিম্ন অর্ডার পরিমাণ:
Min. Order: 25000 kilometers
পণ্যের বিবরণ
প্রাথমিক বিবরণ
সর্বনিম্ন অর্ডার পরিমাণ:Min. Order: 25000 kilometers