Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

100
Views
AWS S3 copyObject 403 access denied

I called s3 api by copyObject. But, i got the 403 error for access denied.

I have configured it as follows.

IAM + CORS settings

IAM is S3FullAccess.

CORS is allowed.

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "PUT",
            "POST",
            "DELETE"
        ],
        "AllowedOrigins": [
            "http://localhost:3002"
        ],
        "ExposeHeaders": []
    }
]

I don't know what I am missing.

code:

import AWS from 'aws-sdk';

AWS.config.update({
  accessKeyId: process.env.NEXT_PUBLIC_AWS_ACCESS_KEY_ID,
  secretAccessKey: process.env.NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY,
})

bucket = new AWS.S3({
  params: { Bucket: 'bucket' },
  region: 'ap-northeast-2',
});

const params = {
  Bucket: 'bucket',
  CopySource: `advertisement_${i}.png`,
  Key: `advertisement_${i}_old.png`,
};

await this.bucket.copyObject(params)
  .send((err => {
    if (err) {
      alert(err);
    } else {
      console.log(`advertisement_${i} is copied`);
    }
  }));
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!