Connect to S3-compatible services

Learn how to connect S3-compatible services to Retool.

You can connect to S3-compatible storage services using Retool's built-in S3 integration and make it available as a resource. Once complete, you can write queries to interact with S3-compatible buckets.

Requirements

All users for Retool organizations on Free or Team plans have global Edit permissions and can add, edit, and remove resources. If your organization manages user permissions for resources, you must be a member of a group with Edit all permissions.

To create an S3 resource, you need to:

  • Obtain the custom endpoint URL of the S3-compatible service.
  • Configure cross-origin resource sharing (CORS) for the S3 bucket.
  • Generate access key credentials.

Before you can create an S3 resource, you must update your S3 bucket configuration to allow Retool access.

1. Configure cross-origin resource sharing (CORS)

Configure CORS to allow Retool access to your S3 bucket. Retool requires GET, PUT, POST, and DELETE. Set the origin to your Retool organization URL.

2. Generate access credentials

Retool authenticates with S3-compatible services using access keys. Generate access credentials and provide them as values for AWS Access Key ID and AWS Secret Key ID.

4. Create an S3 resource

Retool can connect to almost any API or database, and has built-in integrations for popular data sources. Sign in to your Retool organization and create a new S3 resource from the Resources tab.

5. Configure the resource

Provide the necessary details to configure the resource so Retool can connect to the S3-compatible service. Not all settings are required and some are AWS-specific.

General

These settings configure the name and location of the resource within Retool.

Name

The name to use for the resource (e.g., S3).

Folder

The folder in which to save the resource.

Description

A brief description of the resource (e.g., Customer data).

Credentials

These settings configure how Retool connects to S3.

S3 bucket name

The name of the S3 bucket.

Default S3 ACL for uploaded files

The default access control list to use when uploading files, if required.

Use custom S3 endpoint

The custom endpoint URL to use. This enables you to connect to S3-compatible storage services, such as Digital Ocean Spaces.

Enable this option and provide the URL for your S3-compatible service.

Force S3 URLs to use path style

Force S3-compatible services to use path style if connection issues occur. Leave this unchecked unless you experience connection issues.

AWS Access Key ID

The generated access key for the S3-compatible service.

AWS Secret Key ID

The generated access secret key for the S3-compatible service.

Role to assume (ARN)

The role to assume, if required.

6. Save the resource

Click Create resource to complete the setup. You can then click either Create an app to immediately start building a Retool app or Back to resources to return to the list of resources.

Wrap up

Your S3 resource is now ready to use. You write queries to read or write data by specifying the action type and any additional values.

To verify you can successfully interact with the S3-compatible service, write a test query to retrieve a list of all files in the bucket. Select List all files in a bucket as the Action type.

{
  "Contents": [...],
  "Name": "my-s3-bucket",
  "KeyCount": 6,
  "CommonPrefixes": []