How to upload files to S3 using an Multi-Region Access Point in Amplify-js

0

I have created a Multi-Region Access Point using AWS SAM, then I have an angular application with Cognito as identity provider that uses the amplify-js library. I want to upload and download files to s3 from the angular app using the MRAP endpoint, is it possible to work as below?

Amplify.configure({
  Storage: {
    S3: {
      bucket: 'arn:aws:s3::<Account-ID>:accesspoint/<MY_MRAP_ID>.mrap)', 
      region: 'us-east-1' 
    }
  }
});

https://docs.amplify.aws/javascript/tools/libraries/configure-categories/#storage-amazon-s3

Any ideas to make it work using another approach? The amplify-js uses temporary credentials from the Authenticated role from Cognito user that login in the app.

1 Answer
0

you can try to this const awsConfig = { // ... other configurations ... Storage: { AWSS3: { bucket: 'your-bucket-name', // Your bucket name region: 'your-region', // The region of your bucket accessPointArn: 'your-multi-region-access-point-arn', // Your Multi-Region Access Point ARN } } };

Amplify.configure(awsConfig);

profile picture
Jagan
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions