DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Building an AWS Integration for Salesforce Image Handling
  • Object Store Connector in Mulesoft
  • AWS WAF Classic vs WAFV2: Features and Migration Considerations
  • Managing AWS Managed Microsoft Active Directory Objects With AWS Lambda Functions

Trending

  • The Cypress Edge: Next-Level Testing Strategies for React Developers
  • Unlocking the Potential of Apache Iceberg: A Comprehensive Analysis
  • A Developer's Guide to Mastering Agentic AI: From Theory to Practice
  • How to Convert XLS to XLSX in Java
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Configuring Amazon S3 Using Mulesoft

Configuring Amazon S3 Using Mulesoft

Mulesoft provides the Amazon S3 connector to help you easily connect to your S3 and get on with your integration. Follow the tutorial below!

By 
Kuldeep Rana user avatar
Kuldeep Rana
·
Jan. 25, 22 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
11.8K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

Amazon S3 or Amazon Simple Storage Service is a service offered by Amazon Web Services to store objects, download, and use the data kept in the S3, and help to build an application that requires internet storage.

Mulesoft provides the Amazon S3 connector to help you easily connect to your S3 and get on with your integration.

Tutorial  

To get connected to the Amazon S3 using Mulesoft, we have two types of connections:

  1. Basic
  2. Role

Connections screenshot.

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

The Basic connection is used usually when you are the ROOT USER of the AWS Account.

Basic connection screenshot.

To get connected to the Amazon S3 using the Role Connection, you will need the following:

  1. Access Key 
  2. Secret Key 
  3. Region Endpoint
  4.  Role ARN

Role connection screenshot.

Now that our configuration is done, let’s jump into the implementation part and see how we can take benefit from the Amazon S3 Connector.

In the implementation here, we will be focusing on:

  • How to create a bucket.
  • How to upload objects into the bucket.
  • How to retrieve objects from the bucket.

Create an 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 the 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.

Running the flow screenshot.


Upload an Object into the S3 Bucket

Uploading an object screenshot.

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. 

Object placed in bucket screenshot.

Getting an Object From the S3 Bucket

Getting the object screenshot.

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.

Content screenshot.

Similarly, there are many other operations in the Amazon S3 connector like deleting the bucket that we just created above, copying the object from one bucket to the other, deleting an object, or deleting multiple objects, listing all the buckets in a particular AWS Account, and many other more. 

Use the operations according to your use case and build a full-fledged running integration.

Reference Links

  • https://docs.mulesoft.com/amazon-s3-connector/5.7/
  • https://docs.mulesoft.com/amazon-s3-connector/5.7/amazon-s3-connector-examples
AWS Amazon Web Services Object (computer science) MuleSoft Connector (mathematics)

Opinions expressed by DZone contributors are their own.

Related

  • Building an AWS Integration for Salesforce Image Handling
  • Object Store Connector in Mulesoft
  • AWS WAF Classic vs WAFV2: Features and Migration Considerations
  • Managing AWS Managed Microsoft Active Directory Objects With AWS Lambda Functions

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!