Connect to Amazon S3
Learn how to connect to Amazon S3 and upload, download, manage files in Retool.
Amazon S3 (Simple Storage Service) is a scalable object storage service for storing and retrieving data. With Retool's Amazon S3 integration, you can build apps and automations that upload files, download data, generate signed URLs, and manage objects in your S3 buckets.
Retool's S3 integration also works with S3-compatible providers such as Digital Ocean Spaces, MinIO, and Wasabi.
What you can do with Amazon S3
- List and browse files: Display files and folders from S3 buckets in tables or file browsers.
- Upload files: Accept file uploads from users and store them in S3.
- Download files: Retrieve files from S3 for display or processing.
- Generate signed URLs: Create temporary URLs for secure file access without exposing credentials.
- Manage files: Copy, delete, and organize files across buckets with tag support.
Before you begin
To connect Amazon S3 to Retool, you need the following:
- Cloud-hosted organizations
- Self-hosted instances
- AWS account: Access to an AWS account with S3 buckets.
- AWS IAM credentials: Access key ID and secret access key with S3 permissions, or an IAM role to assume.
- S3 bucket: At least one S3 bucket to connect to.
- CORS configuration: S3 bucket must have CORS enabled for cloud instances.
- Retool permissions: Ability to create and manage resources in your organization.
- AWS account: Access to an AWS account with S3 buckets.
- AWS IAM credentials: Access key ID and secret access key with S3 permissions, IAM role to assume, or AWS credentials chain support.
- S3 bucket: At least one S3 bucket to connect to.
- CORS configuration: S3 bucket must have CORS enabled for your Retool instance's domain.
- Retool permissions: Edit all permissions for resources in your organization.
Configure CORS policy
Amazon S3 requires CORS (Cross-Origin Resource Sharing) configuration to allow Retool to access your buckets from the browser.
- Cloud-hosted organizations
- Self-hosted instances
Add the following CORS configuration to your Amazon S3 bucket to allow access from Retool. In the AWS console, navigate to your bucket's Permissions tab, scroll to Cross-origin resource sharing (CORS), and add this configuration:
CORS configuration for cloud instances
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["GET", "PUT", "POST", "DELETE", "HEAD"],
"AllowedOrigins": [
"https://retool.com",
"https://*.retool.com"
],
"ExposeHeaders": ["ETag", "x-amz-meta-custom-header"]
}
]
Replace *.retool.com with your organization's custom domain if applicable.
Add the following CORS configuration to your Amazon S3 bucket to allow access from your self-hosted instance. In the AWS console, navigate to your bucket's Permissions tab, scroll to Cross-origin resource sharing (CORS), and add this configuration:
CORS configuration for self-hosted
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["GET", "PUT", "POST", "DELETE", "HEAD"],
"AllowedOrigins": ["https://retool.example.com"],
"ExposeHeaders": ["ETag", "x-amz-meta-custom-header"]
}
]
Replace retool.example.com with your actual Retool instance domain.
Create an Amazon S3 resource
Follow these steps to create an Amazon S3 resource in your Retool organization.
1. Create a new resource
In your Retool organization, navigate to Resources in the main navigation and click Create new → Resource. Search for Amazon S3 and click the Amazon S3 tile to begin configuration.
Use folders to organize your resources by team, environment, or data source type. This helps keep your resource list manageable as your organization grows.
2. Configure connection settings
Configure the following connection settings for your Amazon S3 resource.
Resource name
Give your resource a descriptive name that indicates which bucket or environment it connects to.
examples of descriptive resource names
production_s3
user_uploads_bucket
backup_storage_s3
marketing_assets_s3
S3 bucket
Specify the name of the S3 bucket you want to connect to. You can configure this to connect to a specific bucket or leave it empty to allow access to any bucket at query time.
static bucket name
my-app-uploads
dynamic bucket with embedded expressions
{{ environment === 'production' ? 'prod-bucket' : 'dev-bucket' }}
S3 region
Select the AWS region where your S3 bucket is located (e.g., us-east-1, us-west-2, eu-west-1). This ensures Retool connects to the correct regional endpoint.
Default ACL
Set the default access control list (ACL) for objects uploaded to S3. Common options include private, public-read, authenticated-read, and bucket-owner-full-control. Leave empty to use the bucket's default ACL.
- Cloud-hosted organizations
- Self-hosted instances
Outbound region
If your organization uses outbound regions, select the region that should be used for requests to Amazon S3. This controls which geographic region your requests originate from.
Self-hosted instances do not have the outbound region option. Requests originate from your Retool instance's network location.
3. Configure authentication
Choose an authentication method based on your deployment type and security requirements. Amazon S3 supports IAM access keys, IAM role assumption, and AWS credentials chain for self-hosted instances.
| Authentication method | Use cases |
|---|---|
| Access Key + Secret Key | Standard authentication with IAM user credentials. Use for development environments, when you have static credentials from AWS IAM, or when you need predictable non-expiring credentials. Most common method for initial setup. |
| IAM role (assume role) | Enhanced security with temporary credentials and automatic rotation. Use for production environments following AWS security best practices, cross-account access to S3 buckets, or when you want short-lived credentials. Requires configuring trust relationships in AWS IAM. |
| AWS credentials chain (self-hosted only) | Automatic credential discovery from your environment. Use when Retool runs on AWS infrastructure with instance profiles or task roles, when you prefer environment-based credential management, or to avoid storing static credentials in Retool. |
- Cloud-hosted organizations
- Self-hosted instances
Cloud organizations can authenticate using Access Key + Secret Key or IAM role (assume role).
option A: Access Key + Secret Key (Recommended)
Use an AWS access key ID and secret access key to authenticate with S3.
1. Create an IAM user with S3 permissions:
In the AWS IAM console, create a user or service account with S3 permissions. Attach a policy that grants the necessary permissions for your use case.
example IAM policy for S3 access
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-bucket/*",
"arn:aws:s3:::my-bucket"
]
}
]
}
2. Generate access credentials:
Create an access key ID and secret access key for the IAM user. Store these credentials securely as they provide full access to your S3 buckets and objects.
3. Configure authentication in Retool:
In the Retool resource configuration, paste the AWS access key ID in the Access Key ID field and the AWS secret access key in the Secret Access Key field.
4. Store credentials securely:
Consider using configuration variables or secrets to store credentials instead of hardcoding them in the resource configuration.
option B: IAM role (assume role)
Use an IAM role with temporary credentials for enhanced security and automatic credential rotation.
1. Create an IAM role with S3 permissions:
In the AWS IAM console, create a role with S3 permissions. Attach a policy that grants the necessary permissions for your use case.
2. Configure trust relationship:
Update the role's trust policy to allow Retool to assume the role. You need to add Retool's AWS account ID and optionally require an external ID for additional security.
example trust policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::RETOOL_AWS_ACCOUNT_ID:root"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": "your-external-id"
}
}
}
]
}
Contact Retool support for the correct AWS account ID to use in the trust policy.
3. Configure role in Retool:
In the Retool resource configuration, select IAM role as the authentication method. Paste the Role ARN (e.g., arn:aws:iam::123456789012:role/RetoolS3Access) and optionally specify an External ID if required by your trust policy.
4. Test the connection:
Click Test connection to verify Retool can assume the role and access your S3 bucket.
Self-hosted instances can authenticate using AWS credentials chain, Access Key + Secret Key, or IAM role (assume role).
option A: AWS credentials chain (Recommended for AWS-hosted instances)
Use the AWS credentials chain to automatically discover credentials from your environment. This method follows AWS security best practices by avoiding static credentials.
1. Configure AWS credentials in your environment:
Ensure your Retool instance has access to AWS credentials through one of these methods:
- EKS service account: Use IAM roles for service accounts (IRSA) to grant S3 access.
- Environment variables: Set
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYenvironment variables. - AWS credentials file: Configure credentials in
~/.aws/credentialson the Retool server.
2. Select AWS credentials chain:
In the Retool resource configuration, select AWS credentials chain as the authentication method. No additional credentials are needed as Retool automatically discovers them from your environment.
3. Verify permissions:
The credentials chain checks for credentials in this order: environment variables, credentials file, EC2 instance metadata, ECS task metadata, EKS service account. Ensure at least one of these methods is configured with appropriate S3 permissions.
option B: Access Key + Secret Key
Use an AWS access key ID and secret access key to authenticate with S3.
1. Create an IAM user with S3 permissions:
In the AWS IAM console, create a user or service account with S3 permissions. Attach a policy that grants the necessary permissions for your use case.
2. Generate access credentials:
Create an access key ID and secret access key for the IAM user.
3. Configure authentication in Retool:
In the Retool resource configuration, paste the AWS access key ID in the Access Key ID field and the AWS secret access key in the Secret Access Key field.
option C: IAM role (assume role)
Use an IAM role with temporary credentials for enhanced security and automatic credential rotation.
1. Create an IAM role with S3 permissions:
In the AWS IAM console, create a role with S3 permissions.
2. Configure trust relationship:
Update the role's trust policy to allow your Retool instance to assume the role. This typically involves trusting the IAM role or user that your Retool instance runs as.
3. Configure role in Retool:
In the Retool resource configuration, select IAM role as the authentication method. Paste the Role ARN and optionally specify an External ID if required by your trust policy.