Skip to main content
Version: 3.6.2-rc.2

Connect an S3 bucket

Use an S3 source to sync files from an Amazon S3 bucket, or from another storage service with an S3-compatible API. This page covers setting up the bucket and a read-only key in AWS, then the fields to fill in on the Add data source page. For the steps around them, see Add a data source.

The endpoint reaches the bucket over the internet, so its address must resolve to a public IP address. Keep the bucket private: the endpoint signs in with an access key and doesn't need public access.

Already have a bucket? Start at step 2. Already have an access key with the policy? Go to Fill in the fields.

1. Create a bucket​

  1. Open the Amazon S3 console and select Create bucket.
  2. Select General purpose as the bucket type.
  3. Enter a unique bucket name.
  4. Select the AWS region closest to the platform. Note its region code, such as eu-west-1.
  5. Keep Block all public access turned on.
  6. Select Create bucket.
  7. Open the bucket and upload the files to sync.

See Create a bucket for all bucket options.

2. Create a read-only IAM policy​

The endpoint only lists the bucket and reads its files, so it needs two permissions: s3:ListBucket and s3:GetObject.

  1. Open the IAM console.
  2. Select Policies → Create policy.
  3. Select JSON and enter the policy below.
  4. Replace both instances of company-documents with your bucket name.
  5. Select Next, name the policy, and select Create policy.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::company-documents"
},
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::company-documents/*"
}
]
}

If the files are encrypted with an AWS KMS customer-managed key, also allow kms:Decrypt on that key.

See Create an IAM policy for the full AWS steps.

3. Create a user and an access key​

  1. In the IAM console, select Users → Create user.
  2. Enter a name such as confidentialmind-rag-reader. It doesn't need console access.
  3. On the permissions step, attach the policy from step 2.
  4. Create the user, open it, then select Security credentials.
  5. Under Access keys, select Create access key.
  6. Select Other → Next → Create access key.
  7. Copy the Access key ID and Secret access key, or download the CSV. AWS shows the secret only once.

To do these steps, your AWS account needs s3:CreateBucket, iam:CreatePolicy, iam:CreateUser, iam:AttachUserPolicy and iam:CreateAccessKey, plus the read and list actions the AWS console uses. The key you give the platform needs only the policy from step 2.

See Create an IAM user and Manage access keys.

Fill in the fields​

On the Add data source page, choose S3 as the Provider, then fill in:

FieldWhat to enterExample
EndpointThe S3 API URL, including https:// (http:// also works, for an S3-compatible store without TLS). For AWS, use the regional endpoint from the S3 endpoint list.https://s3.eu-west-1.amazonaws.com
RegionThe region that holds the bucket.eu-west-1
BucketThe bucket name, without a path or URL.company-documents
Prefix (optional)A folder path inside the bucket, ending with / and not starting with one. Leave blank to sync the whole bucket.knowledge-base/reports/
Access key IDThe access key from step 3.AKIAIOSFODNN7EXAMPLE
Secret access keyThe secret for that key.

For another S3-compatible service, use the endpoint, region and keys that service gives you.

Then choose a sync interval and create the source.

Troubleshooting​

  • The connection test fails: check the endpoint URL, region and keys. An endpoint that resolves to a private IP address is rejected.
  • No objects were read: check the bucket name and prefix, the IAM policy and, for encrypted files, the KMS permission.