Create Shareable link to private S3 Files using MuleSoft

AWS is one of the most popular Cloud platform. Check a detailed post on AWS S3 here:

Integrating AWS S3 with MuleSoft
AWS is one of the most popular Cloud platform. Check a detailed post on AWShere: AWS Cloud ComputingAWS and its use.The BitmaskersTirthankar Kundu [/aws/]> AWS S3Amazon Simple Storage Service (Amazon S3) is an object storage service thatoffers industry-leading scalability, data availability, sec…

The Problem

Now let us talk about the use case we are trying to solve.

We want to share some of the private files in AWS S3 to external users for a limited period.

The Solution

AWS S3 allows us to solve this problem using Presigned URLs.

All objects by default are private. Only the object owner has permission to access these objects. However, the object owner can optionally share objects with others by creating a presigned URL, using their own security credentials, to grant time-limited permission to download the objects.

Now let us create the integration using MuleSoft

Connector Configuration
  • First import the AWS S3 connector from Exchange
  • Create a Connector configuration as below

Create a private flow or a sub flow to generate presigned url

  1. We set the bucket name
  2. We set the key of the object/file we want to share
  3. We set the time till which the url is suppose to be active
  4. We use the S3 Create object presigned uri operation to generate shareable url
  5. We Transform the message to show output

The payload here will have the presigned URL.

Hope you liked it. Cheers ✔

Tirthankar Kundu

Tirthankar Kundu