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 Antwort
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
beantwortet vor 4 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen