> ## 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

<Steps>
  <Step title="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`).
  </Step>

  <Step title="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/*"
          ]
        }
      ]
    }
    ```
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Add the destination in Cometly">
    In the dashboard, go to **Integrations → Data Exports → Add destination** and enter:

    <ParamField path="Name" type="string" required>
      A label for this destination, for example "Production warehouse".
    </ParamField>

    <ParamField path="Bucket name" type="string" required>
      The S3 bucket name from Step 1.
    </ParamField>

    <ParamField path="Region" type="string" required>
      The bucket's AWS region.
    </ParamField>

    <ParamField path="Access Key ID" type="string" required>
      The Access Key ID from Step 4.
    </ParamField>

    <ParamField path="Secret Access Key" type="string" required>
      The Secret Access Key from Step 4.
    </ParamField>
  </Step>
</Steps>

<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.
</Note>

<Warning>
  Grant the IAM user access only to the bucket used for exports. Avoid reusing a broadly privileged
  access key.
</Warning>

## Next step

<Card title="Create an export" icon="cloud-arrow-up" href="/data-warehouse/create-export">
  Choose this destination, a dataset, and a date range.
</Card>
