AWS Error PermanentRedirect

·

1 min read

So, if you want to upload a file with AWS S3 and encounter an error like:

PermanentRedirect: The bucket you are attempting to access must
 be addressed using the specified endpoint.
 Please send all future requests to this endpoint.

You should recheck your region setting. In most cases, you may have specified the incorrect region.

javascriptCopy codeexport const createS3Client = () => {
  const REGION = "us-west-2"; // Is the incorrect region; perhaps it should be us-west-1?
  return new S3Client({ region: REGION });
};