AWS is one of the most popular Cloud platform. Check a detailed post on AWS S3 here:
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.
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
- 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
- We set the bucket name
- We set the key of the object/file we want to share
- We set the time till which the url is suppose to be active
- We use the S3 Create object presigned uri operation to generate shareable url
- We Transform the message to show output
The payload here will have the presigned URL.
Hope you liked it. Cheers ✔