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

# Set up an S3 destination

> Create an AWS IAM user and S3 bucket so Cometly can write export files to your account.

## Overview

A **destination** is a reusable connection to an S3 bucket you own. You configure it once, then point any number of exports at it. Cometly authenticates with an **IAM access key** that has write access to your bucket.

## Prerequisites

* An AWS account with permission to create S3 buckets and IAM users and policies.
* A space administrator role in Cometly.

## Create the bucket and credentials

**1. Create or choose an S3 bucket**

In the AWS S3 console, create a bucket (or choose an existing one) for Cometly exports, and note
its **name** and **region** (for example, `us-east-1`).

**2. Create an IAM policy**

In the AWS IAM console, create a policy that grants write access to that bucket. Replace
`YOUR_BUCKET_NAME` with your bucket name.

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

**3. Create an IAM user**

Create a dedicated IAM user (for example, `cometly-exports`) for programmatic access only, and
attach the policy from the previous step.

**4. Generate an access key**

For that user, create an access key. Save the **Access Key ID** and **Secret Access Key** — the
secret is shown only once.

**5. Add the destination in Cometly**

In the dashboard, go to **Integrations → Amazon S3 → Add destination** and enter:

**Name** `string` *required*

A label for this destination, for example "Production warehouse".

**Bucket name** `string` *required*

The S3 bucket name from Step 1.

**Region** `string` *required*

The bucket's AWS region.

**Access Key ID** `string` *required*

The Access Key ID from Step 4.

**Secret Access Key** `string` *required*

The Secret Access Key from Step 4.

> [!NOTE]
>
> Your Secret Access Key is encrypted at rest and never shown again. When editing a destination,
> leave the secret blank to keep the existing key.

> [!WARNING]
>
> Grant the IAM user access only to the bucket used for exports. Avoid reusing a broadly privileged
> access key.

## Next step

> [card] [Create an export](https://docs.cometly.com/data-warehouse/create-export.md)
>
> Choose this destination, a dataset, and a date range.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.