The Ballerina AWS S3 provides the capability to manage buckets and objects in AWS S3.

This module supports Amazon S3 REST API 2006-03-01 version.


Before using this connector in your Ballerina application, complete the following:

  1. Create an AWS account
  2. Obtain tokens


To use the AWS S3 connector in your Ballerina application, update the .bal file as follows:

Step 1: Import connector

Import the ballerinax/aws.s3 module into the Ballerina project.


Step 2: Create a new connector instance

Create a s3:ConnectionConfig with the tokens obtained, and initialize the connector with it.


Step 3: Invoke connector operation

  1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.
    Following is an example on how to create a bucket using the connector.

  2. Use bal run command to compile and run the Ballerina program.

You can find a list of samples here

Other versions

See more...