S3

Guide to connect S3 to Velvet

Connect your S3 database to your Velvet workspace. You can skip some steps if you've previously connected to other services.

1. Create a read-only user

Create a user with read-only permissions in S3.

Create an IAM user

Attach a bucket policy that grants read access to the user.

  1. Go to the IAM console in your AWS account.
  2. Click on "Users" and then "Add user."
  3. Provide a name for the user and select "Programmatic access" as the access type.
  4. Click "Next" to move on to permissions.

Add read-only permissions

  1. Choose an existing policy that grants read-only access to S3, such as "AmazonS3ReadOnlyAccess." Or, create a new policy with the following permissions:
{
    "Version": "2024-02-01",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": [
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::YOUR-BUCKET-NAME/*"
            ]
        }
    ]
}
  1. Replace your-bucket-name with the actual name of your S3 bucket.
  2. Click on "Next: Tags" > "Next: Review." Replace "YOUR-BUCKET-NAME" with the actual name of your S3 bucket.

Create Access Keys

  1. Click on "Create user" to finish creating the user.
  2. Store the access key ID and secret access key. You will need them for programmatic access to S3.

2. Set static IPs

Configure network restrictions to allow Velvet's static IP addresses. Follow our static IP configuration guide.

3. Build your connection string

Read our general guide on URI construction here.

4. Connect your database

Connect your database to Velvet using your connection string.

  1. Tap into a workspace in your Velvet dashboard
  2. Tap "Add a data source"
  3. Select type "Remote database"
  4. Name your database
  5. Paste in your database URI
  6. Press create

If you run into any errors, schedule a call or email [email protected].

Once your database is connected, you're ready to use the AI SQL editor. Close out of the modal to start using the editor on top of your database.

Schema mapping is optional, and only required if you want to query multiple sources at the same time.

5. [optional] Schema mapping for unified sources

This configuration is only required to query multiple data sources at the same time. For example - two databases at the same time, or stripe webhooks alongside your database tables.

You can set up this unified mapping any time.

Add schema mapping context

After you connect your database, you'll be prompted to configure the schema for each table you set up.

Name your table to create this source.

Repeat these schema mapping steps for each table you want included as a unified data source.

Get help

Email [email protected] if you need additional support.