Prerequisites
You need an active AWS account and an S3 bucket for integration. Ensure that you have already created the required S3 bucket in your account before proceeding with the following steps.
Steps
- Enter your bucket name in CloudFiles
- Open the CloudFiles app in Salesforce and navigate to Document Management > Libraries. Click on AWS S3. (If you do not see the AWS S3 option, click Manage Libraries and add it first)
- Click Connect, enter your S3 bucket name, and continue.
- Download the CloudFormation template
- Note down the External ID shown on screen, then download the CloudFormation template that is generated.
- Head over to the AWS Management Console after this step.
- Access AWS CloudFormation
- In the AWS Management Console, search for and select 'CloudFormation'.
- Create a New Stack
- Click on “Create stack” and select “With new resources (standard)”.
- Choose “Template is ready” under the “Prepare template” options.
- Upload the CloudFormation Template
- Select “Upload a template file”.
- Click on “Choose file” and upload the CloudFormation template you downloaded in step 2.
- Click “Next”.
- Specify Stack Details
- Enter a name for your stack. For example, “CloudFilesS3Integration”.
- Fill in any parameters required by the template, if applicable.
- Click “Next”.
- Configure Stack Options (Optional)
- Configure any additional options like tags or permissions if necessary.
- Click “Next”.
- Review and Create the Stack
- Review all settings and details. Make sure everything is correct.
- Acknowledge that AWS CloudFormation might create IAM resources.
- Click “Create stack”.
- Wait for Stack Creation
- The stack creation process might take a few minutes. Wait until the status changes to “CREATE_COMPLETE”.
- Obtain the Outputs
- Once the stack creation is complete, go to the “Outputs” tab of your stack.
- Note down the ‘Role ARN’ values. This is essential for connecting your S3 bucket to CloudFiles.
- Enter Details in CloudFiles
- Log into your CloudFiles account.
- Navigate to the S3 bucket integration section.
- Enter the ‘Role ARN’ you noted down earlier. Also enter the following fields.
- Prefix (optional): This defines the folder path within your S3 bucket that CloudFiles will use. This lets you organise data within a specific section of the bucket rather than the entire bucket. Leave it empty to connect the whole bucket.
- Connect read-only (optional): Select this if CloudFiles should only read this bucket and never add, change or delete anything in it, for example when another org already writes to it. If your IAM role is not allowed to write to the bucket, CloudFiles connects read-only automatically.
- Drive label: The display name for this storage connection in CloudFiles. This is what users will see when accessing or selecting a storage location. It is optional for the first bucket connected in your org but required for any additional connections.
- Save your settings.
After entering the details in CloudFiles, your S3 bucket should now be successfully connected to your CloudFiles account. You can start managing and accessing your S3 files directly through CloudFiles.
If the bucket is already connected in this org or a related org, you see the 'Reuse Existing Connection' step instead, and no AWS setup is needed. Enter a prefix, or leave it empty to connect the whole bucket, and select 'Connect read-only' if needed.
When you need a prefix, a drive label or read-only depends on where the bucket is already connected. A production org and its sandboxes are related orgs. Any other org is unrelated.
| Connecting | Prefix | Drive label | Read-only |
|---|---|---|---|
| First bucket in this org | Optional | Optional | Optional |
| Another bucket in this org | Optional | Required | Optional |
| Same bucket again in this org | Required, and must not overlap the other connection | Required | Optional |
| Same bucket as a related org | Optional, and may overlap | Required if this org already has a bucket | Required if the paths overlap and the other org already writes there |
| Same bucket as an unrelated org | Required, and must not overlap the other org's | Required if this org already has a bucket | Optional |
Two connections overlap when they use the same prefix, when one prefix sits inside the other (for example, team-a and team-a/2026), or when either has no prefix, because an empty prefix covers the whole bucket.
To connect the same bucket twice in one org, both connections need a prefix. If the first one has none, disconnect it and reconnect it with a prefix.
- Enable sync (optional)
- Toggle on Enable Sync to automatically reflect changes from your S3 bucket in CloudFiles.
- Once enabled, any files or folders uploaded, updated, or deleted in S3 will appear in CloudFiles.
Sync only applies to changes made after the toggle is enabled. Existing files in your S3 bucket will not appear automatically in CloudFiles. To make historical data available, a custom migration is required — contact support@cloudfiles.io for details.
If your S3 bucket was connected before the automated sync setup was introduced, enabling sync may require updating the IAM role permissions first. See How to enable Auto Sync for old S3 buckets connected in CloudFiles for steps.