ballerinax/aws.s3 Ballerina library

2.2.1

Overview

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.

Prerequisites

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

  1. Create an AWS account
  2. Obtain tokens

Quickstart

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.

Copy
import ballerinax/aws.s3;

Step 2: Create a new connector instance

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

Copy
s3:ConnectionConfig amazonS3Config = {
    accessKeyId: <ACCESS_KEY_ID>,
    secretAccessKey: <SECRET_ACCESS_KEY>,
    region: <REGION>
};

s3:Client amazonS3Client = check new(amazonS3Config);

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.

    Copy
    string bucketName = "name";
    
    public function main() returns error? {
        _ = check amazonS3Client->createBucket(bucketName);
    }
  2. Use bal run command to compile and run the Ballerina program.

You can find a list of samples here

Import

import ballerinax/aws.s3;Copy

Metadata

Released date: over 2 years ago

Version: 2.2.1

License: Apache-2.0


Compatibility

Platform: java11

Ballerina version: 2201.0.1


Pull count

Total: 11415

Current verison: 2207


Weekly downloads


Source repository


Keywords

Content & Files/File Management & Storage

Cost/Paid

Vendor/Amazon


Contributors

Other versions

See more...