> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: Amazon S3 Source

> How to connect to Amazon S3 and configure the S3 source component to read files in your Integrate.io ETL pipeline.

The Amazon S3 source reads files from an S3 bucket and feeds them into your pipeline. It supports CSV, TSV, JSON, Excel, Parquet, Raw, and compressed formats.

Once your connection is set up, see [File Storage Options](/docs/etl/file-storage-options) for the full set of read options (file formats, schema, and more) shared across every file storage provider.

## Connection Setup

### Create an IAM User

<Steps>
  <Step>
    Log into the AWS Management Console and open **IAM (Identity and Access Management)**.
  </Step>

  <Step>
    In the left navigation, click **Users**, then click **Add User**.

    <Frame>
      <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/connectivity-and-security/image-81.webp?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=83b90788efa4448787609ea90ce84aff" alt="IAM Users page with Add User button" width="1200" height="522" data-path="images/connectivity-and-security/image-81.webp" />
    </Frame>
  </Step>

  <Step>
    Enter a user name (for example, `integrate-io-etl`) and select **Programmatic access**. Click **Next: Permissions**.

    <Frame>
      <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/connectivity-and-security/image-82.webp?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=e1ee21abf266d4f3727ff35c951cb5e3" alt="IAM Add User form with programmatic access selected" width="1200" height="808" data-path="images/connectivity-and-security/image-82.webp" />
    </Frame>
  </Step>

  <Step>
    Click **Create User**. On the confirmation page, click **Download .csv** and save the credentials file. You will need the Access Key ID and Secret Access Key when creating the connection in Integrate.io.

    <Frame>
      <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/connectivity-and-security/image-84.webp?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=4701d7c126affacb0399db7fbc27396f" alt="Download CSV button to save security credentials" width="1200" height="463" data-path="images/connectivity-and-security/image-84.webp" />
    </Frame>
  </Step>
</Steps>

<Note>
  If any credential key contains a slash, or you cannot locate the downloaded credentials file, return to the IAM user, click **Make inactive** under Security credentials, then click **Create access key** to generate new credentials.
</Note>

<Note>
  Never use an underscore in an S3 bucket name, and never end a bucket name with a dash. Both will prevent Integrate.io from accessing the bucket correctly.
</Note>

### Attach an S3 Policy to the IAM User

<Steps>
  <Step>
    In the IAM user list, click the user you created. Scroll down to **Add permissions**.
  </Step>

  <Step>
    For **read-only** access, attach the **AmazonS3ReadOnlyAccess** managed policy.

    <Frame>
      <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/connectivity-and-security/image-87.webp?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=a2b68f52d86169d789a9ee98576fc56d" alt="Attaching AmazonS3ReadOnlyAccess policy to the IAM user" width="1200" height="656" data-path="images/connectivity-and-security/image-87.webp" />
    </Frame>
  </Step>

  <Step>
    For **read-write** access (required for destination pipelines), click **Create policy**, choose **JSON**, and paste the following policy, replacing `bucket-name` with your bucket name:

    ```json theme={null}
    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "ListObjectsInBucket",
                "Effect": "Allow",
                "Action": ["s3:ListBucket"],
                "Resource": ["arn:aws:s3:::bucket-name"]
            },
            {
                "Sid": "ReadWriteObjects",
                "Effect": "Allow",
                "Action": [
                    "s3:PutObject",
                    "s3:GetObject",
                    "s3:DeleteObject"
                ],
                "Resource": ["arn:aws:s3:::bucket-name/*"]
            }
        ]
    }
    ```

    <Note>
      All three object actions are required for destination pipelines. Integrate.io writes each output file to a temporary object and then finalizes it, which on S3 is a copy-and-delete operation. Granting only `s3:PutObject` causes writes to fail during finalization.
    </Note>

    Click **Review policy**, then **Create policy**.
  </Step>
</Steps>

### Create the Connection in Integrate.io ETL

<Steps>
  <Step>
    Click the **Connections** icon (lightning bolt) in the top-left menu.
  </Step>

  <Step>
    Click **New connection**.

    <Frame>
      <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/connectivity-and-security/image-89.webp?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=cbb891400f1e2e177baf68f2b1c23431" alt="New connection button in the Connections menu" width="1200" height="830" data-path="images/connectivity-and-security/image-89.webp" />
    </Frame>
  </Step>

  <Step>
    Select **Amazon S3**.

    <Frame>
      <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/connectivity-and-security/image-90.webp?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=cb8dfdadaa1034273e4f90f4cd83699f" alt="Selecting Amazon S3 from the connection type list" width="1200" height="830" data-path="images/connectivity-and-security/image-90.webp" />
    </Frame>
  </Step>

  <Step>
    Name the connection and enter the **Access Key ID** and **Secret Access Key** from the credentials file.

    <Frame>
      <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/connectivity-and-security/image-91.webp?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=373260906e66a17ec7424faef8b027c8" alt="Amazon S3 connection form with access key and secret fields" width="1200" height="830" data-path="images/connectivity-and-security/image-91.webp" />
    </Frame>
  </Step>

  <Step>
    If your S3 buckets are in a region that requires AWS Signature Version 4, enter the region. See the [AWS region list](https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) for applicable regions.
  </Step>

  <Step>
    Click **Test connection** to verify the credentials, then click **Create amazon s3 connection**.

    <Frame>
      <img src="https://mintcdn.com/integrateio/2ttHYDu3EKov-VoY/images/connectivity-and-security/image-92.webp?fit=max&auto=format&n=2ttHYDu3EKov-VoY&q=85&s=b16b69a06f90d130b5a0edece142822a" alt="Amazon S3 connection created and listed in connections" width="1200" height="830" data-path="images/connectivity-and-security/image-92.webp" />
    </Frame>
  </Step>
</Steps>

***

## Source Configuration

### Connection

Select your Amazon S3 connection from the dropdown, or create a new one using the steps above.

### Bucket

Enter the name of the S3 bucket that contains your source files.

### Source Path

The path to the input file, folder, or pattern within the bucket.

| Example                 | Description                         |
| :---------------------- | :---------------------------------- |
| `sales/2015/01/`        | All files in a folder               |
| `sales/2015/01/log.csv` | A single file                       |
| `sales/2015/{01,02}/`   | A pattern matching multiple folders |

You can use wildcard characters for [pattern globbing](/docs/etl/using-pattern-matching-in-source-component-paths). File and directory names beginning with an underscore (`_`) or a dot (`.`) are ignored.

<Snippet file="snippets/file-storage-source-format.mdx" />

### Source Action

<Note>
  All four source actions are available for Amazon S3. When using **Move processed files**, the **Append string to filename** option is supported.
</Note>

<Snippet file="snippets/file-storage-source-action.mdx" />

<Snippet file="snippets/file-storage-source-tail.mdx" />

***

## FAQ

**What IAM permissions does Integrate.io need for a source-only connection?**

Attach **AmazonS3ReadOnlyAccess** to the IAM user, or create a custom policy granting `s3:ListBucket` on the bucket and `s3:GetObject` on its objects.

**What permissions are needed for a destination pipeline?**

The IAM user needs `s3:ListBucket`, `s3:PutObject`, `s3:GetObject`, and `s3:DeleteObject`. All three object actions are required because Integrate.io finalizes output files with a copy-and-delete operation.

**Why does Integrate.io require all three object actions for writes?**

Integrate.io writes each output file to a temporary object first, then finalizes it. On S3, finalization is a copy (`GetObject`) followed by deletion of the temporary object (`DeleteObject`). Without all three, the finalization step fails.

**Can I connect to a bucket in a region that requires Signature Version 4?**

Yes. Enter the bucket's AWS region in the connection form. See the [AWS region list](https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) for regions that require Sig v4.

***

## Related

<CardGroup cols={2}>
  <Card title="Amazon S3 Destination" icon="arrow-right" href="/docs/etl/using-components-amazon-s3-destination" horizontal />

  <Card title="File Storage Options" icon="arrow-right" href="/docs/etl/file-storage-options" horizontal />

  <Card title="Pattern Matching in Source Paths" icon="arrow-right" href="/docs/etl/using-pattern-matching-in-source-component-paths" horizontal />

  <Card title="Reading File Storage Data Incrementally" icon="arrow-right" href="/docs/etl/how-do-i-read-data-from-file-storage-incrementally" horizontal />

  <Card title="PGP Keys" icon="arrow-right" href="/docs/etl/pgp-keys-account-level" horizontal />

  <Card title="Selecting File Input Format" icon="arrow-right" href="/docs/etl/how-do-i-select-my-file-input-format" horizontal />
</CardGroup>
