Configuring Amazon S3 Using MuleSoft

  1. Basic
  2. Role
  • To get connected to the Amazon S3 using the Basic connection, you will need the following :
  1. Access Key
  2. Secret Key
  3. Region Endpoint
  • To get connected to the Amazon S3 using the Role Connection, you will need the following :
  • How to create a bucket.
  • How to upload objects into the bucket.
  • How to retrieve objects from the bucket.
  1. Create a S3 Bucket
  • When you are done with the Amazon S3 configuration in the global elements tab, drag and drop the Create Bucket operation from the mule palette. If you haven’t already downloaded the module for the S3, go to the mule palette and search in exchange for the S3 Connector.
  • Once you have the create bucket operation, just add the Connector configuration from the drop down and add the bucket name for your bucket to be displayed in the AWS S3.
  • Run the flow and if it executes successfully, you can see your bucket in your AWS Account.
  1. Upload an Object into the S3 Bucket
  • Drag the Create Object operation from the mule palette. Add the connector configuration.
  • Here we have to add two things to the connector, which are: The Bucket Name to which the file is to be uploaded (as an AWS can have multiple buckets) and the Key, which is the name of the object to be uploaded (in my case it is the name of the file).
  • Setup your flow according to the implementation above and run it. If the flow gets executed successfully, you can see the object getting placed in the bucket.
  1. Getting an Object from the S3 Bucket
  • Drag the Get Object operation from the mule palette. Add the connector configuration.
  • Here we have to add two things to the connector, which are: The Bucket Name from which the file is to be fetched (as an AWS can have multiple buckets) and the Key which is the name of the object to be fetched (in my case it is the name of the file).
  • Setup your flow according to the implementation above and run it. If the flow gets executed successfully, you can see the content of the object in the logger or in the postman.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store