Skip to main content

AWS S3

Amazon S3 (Simple Storage Service) is a service from Amazon Web Services offering object storage through a web service interface. Amazon S3 can be used to store and retrieve any amount of data from anywhere.

Prerequisite

Before configuring the AWS S3 Connector to interact with your Amazon S3 storage resources, ensure you have the following:

  1. Amazon Web Services (AWS) Account: Have an active AWS account and access to the AWS Management Console.

  2. Access and Secret Access Keys: Obtain your AWS Access Key ID and Secret Access Key from the AWS IAM (Identity and Access Management) service. These credentials will be used to authenticate the connector with your AWS account.

  3. Bucket and Object Information: Identify the specific Amazon S3 bucket(s) and object(s) you intend to work with using the connector. Gather the bucket names and object paths you plan to use during configuration.

  4. Region: Be aware of the AWS region where your Amazon S3 resources are located. Different regions might have distinct endpoint URLs.

  5. IAM Role and Permissions: If generating IAM (Identity and Access Management) role keys, ensure that the IAM role associated with the AWS account has necessary permissions to access Amazon S3 resources. Permission can be granted through the AWS IAM console by creating a new group or modifying an existing group's permissions.

  6. EC2 Instance Access (Optional): For EC2 instances, you can provide the IAM role access to the instance, allowing it to interact with S3 buckets without requiring explicit access keys. This can be accomplished by using EC2 Instance Profile and selecting "Use EC2 IAM Access Role" during configuration.

  7. S3 URLs and Custom Endpoints (Optional): If needed, be aware that you have the option to provide S3 URLs to enable path-style access or use custom endpoint base URLs. This is particularly useful for connecting to S3-compatible services like DigitalOcean Spaces or Wasabi.

Configuring API Connector in DronaHQ

  1. Enter an identifiable Account name.

  2. Provide your Access Key and Secret Key from your AWS IAM account. Alternatively, you can choose to enable Use EC2 IAM Access Role if you want to grant an EC2 instance permission to access S3 resources without explicit credentials.

  3. Specify the appropriate AWS region where your S3 resources are located.

  4. If needed, you can include S3 URLs for path style and custom endpoint base URLs, which is useful for connecting to S3-compatible services like Digital Ocean Spaces or Wasabi.

  5. After entering all the required information, click Save to complete the connector configuration.

AWS S3 with configuration details.
AWS S3 with configuration details.

After successfully configuring and saving the connector settings, you can easily access your newly connected account by navigating to the connected accounts list. You can find this option from the Connector -> Manage Account section. This centralized location allows you to conveniently monitor and manage your connected accounts.

Supported API endpoints

ActionDescription
ReadFileRead the contents of a file stored in a specific S3 bucket.
DownloadFileDownload a file from a specific S3 bucket to your local system.
GetPreSignedUrlGenerate a pre-signed URL for a specified S3 object, providing temporary access to the object.
UploadFileUpload a file to a specific S3 bucket, allowing you to store files within your S3 storage.
ListBucketsRetrieve a list of all S3 buckets associated with your AWS account.
ListObjectsList objects (files) within a specified S3 bucket, along with their details.
DeleteObjectsDelete multiple objects from an S3 bucket using their keys.
CopyObjectCopy an object from one S3 bucket or location to another, retaining metadata and access permissions.
ReadFileRead contents from specified file from s3 bucket using their key. For binary file it returns base64 value.
DownloadFileDownloads the specified file from s3 bucket using their key. This works in actionflow only by keeping Download as File toggle on.

Using AWS S3 connector

List Objects in a Bucket

  1. Add a Tablegrid control and then Bind Data. Add a connector and select the action as ListObjects. Select the Configured account.

  2. Provide the Bucket name from where you would list out the objects.

Listing Objects
  1. Test the connection and click Finish.

  2. Select the Keys to get the data from the connector.

Uploading files to the bucket

Let us assume that we have a form where we select the Bucket name, the folder name to upload the files to, and the File upload control to enable uploading of the file/s. Let us add an action button that triggers the action flow to upload files.

  1. On the button_click event of the action button, add the Server-side action > AWS S3 connector and choose the action UploadFile.

  2. Select the Connected account and click Continue.

  3. Provide Bucket name, add the folder name (which is optional), and provide the Files using the Fileupload control’s name from the Use keywords. Click Continue.

Listing Objects
  1. Add the action name and provide the variable that returns the URL
Listing Objects

Downloading file from the bucket

Let us assume that we have a form where we specify the Bucket name, file key. Let us add an action button that triggers the action flow to download file.

  1. On the button_click event of the action button, add the Server-side action > AWS S3 connector and choose the action DownloadFile.

  2. Select the Connected account and click Continue.

  3. Provide Bucket name, add the folder name (which is optional), and file key. Click Continue.

Download File
  1. Turn Download as File toggle on and click on finish.
Download as a File toggle