# Export to AWS S3

> Last updated: 2026-12-02.
> For the complete documentation index, see [llms.txt](https://docs.temporal.io/llms.txt).
> Any documentation page is available as raw Markdown by appending `.md` to its URL.
> For related questions, query `https://docs.temporal.io/api/retrieve?q=<question>&jtb=<job-to-be-done>&src=md-page&agent=<your-name>` (no auth; returns JSON `{content, source_url, page_url}`, with `source_url` pointing to Markdown for docs pages). Don't include personal data or credentials.
> If this page is wrong or missing something you needed, or Temporal behaves differently from what it says, report it with `https://docs.temporal.io/api/feedback?title=<summary>&message=<what-happened>&category=documentation&page_url=/cloud/export/aws-export-s3&src=md-page&agent=<your-name>` (use `category=product` when the product, not the page, is wrong). Report only a specific problem you hit, send it once, and don't include personal data or credentials.

> Export closed Workflow and Standalone Activity Executions from a Temporal Cloud Namespace to an AWS S3 bucket.

## Prerequisites

Before configuring the Export Sink, ensure you have the following:

- An AWS S3 bucket.
   - The S3 bucket must reside in the same region as your Namespace.
- (Optional) An IAM role that has write permission to the above S3 bucket.
   - You can follow the automation in the UI to create the IAM role. Please pre-create the role if setting up Export via Terraform or the CLI.
- (Optional) A KMS ARN associated with the S3 bucket.

## Configure export 

<a id="configure-workflow-history-export"></a>

There are multiple ways to configure export: through the [Temporal Cloud UI](#using-temporal-cloud-ui), the [CLI](#using-the-cli), or [`terraform`](#using-terraform).

See [export timing and delivery guarantees](/cloud/export#timing-and-delivery-guarantees).

An export sink exports closed Workflow Executions and closed [Standalone Activity](/standalone-activity) Executions by default.
To export Workflow Executions only, disable Standalone Activity export on the sink.
See [Choose which executions to export](/cloud/export#execution-types).

> **Pre-release**
> Export for Standalone Activities is in Pre-release.
> It's on by default for every export sink and isn't billed during Pre-release.
> Billing starts February 1, 2027 at 0.25 Action per exported Standalone Activity.
> To export Workflow Executions only, see [Choose which executions to export](/cloud/export#execution-types).

### Using Temporal Cloud UI

You can use the Temporal Cloud UI to configure Export.

The Temporal Cloud UI provides two ways for configuring Export:

- [Automated setup](#automated-setup) (recommended): The Cloud UI launches the AWS CloudFormation Console to create a stack with write permission to the S3 bucket.
- [Manual setup](#manual-setup): The Cloud UI provides a CloudFormation template for users to manually configure a CloudFormation stack.

> **ℹ️ Info:**
> Why does Temporal Cloud provision multiple internal IAM roles to trust for Export?
>
> Temporal Cloud creates multiple intermediary IAM roles for export operations for security purposes. 
> The system randomly selects from these roles when writing to your storage sink, which provides several benefits:
>
> - **Security isolation**: If one IAM role is compromised or needs to be decommissioned, other IAM roles remain available
> - **Load distribution**: Avoids relying on a single IAM role, reducing security risk
> - **Warm standby**: Keeps multiple IAM roles active to avoid potential throttling when switching between IAM roles
> - **Reliability**: Provides resilience against cloud provider account-level issues that could affect a single IAM role
>
> This approach prioritizes security and availability, ensuring robust export operations even if individual IAM roles encounter issues.

The following steps guide you through setting up Export using the Temporal Cloud UI.

![](https://docs.temporal.io/img/cloud/gcp/export-sink-ui.png)

> **💡 Tip:**
>
> Don't forget to click **Create** at the end of your setup to confirm your export.
>

#### Automated setup

You can use the automated setup to create a CloudFormation stack with write permission to your S3 bucket.
Make sure to verify the export setup before you save the configuration.

1. Open the Temporal Cloud UI and navigate to the Namespace you want to configure.
2. Select **Configure** from the **Export** card.
3. Provide the following information to configure the export sink and then select **Create and launch stack**:
   - Name: A name for the export sink.
   - AWS S3 Bucket Name: The name of the configured AWS S3 bucket to send closed executions to.
   - AWS Account ID: The AWS account ID.
   - Role Name: The name of the AWS IAM role to use for the CloudFormation stack that has write permission to the S3 bucket.
   - KMS ARN: (optional) The ARN of the AWS KMS key to use for encryption of the exported data.
   - Standalone Activity export: On by default. Turn it off to export Workflow Executions only.
4. You will be taken to the CloudFormation Console to create the stack with pre-populated information.
   - Review the information and then select **Create stack**.

To change Standalone Activity export on an existing sink, edit the sink from the **Export** card and turn Standalone Activity export on or off.
Workflow export continues either way.

#### Manual setup

You can manually configure a CloudFormation stack using the provided template.

1. Open the Temporal Cloud UI and navigate to the Namespace you want to configure.
2. Select **Configure** from the **Export** card.
3. Select **Manual** from **Access method**.
   - Enter the Template URL into your web browser to download your copy of the CloudFormation template.
   - Configure the CloudFormation template for your export sink.
   - Follow the steps in the [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-using-console-create-stack-template.html) by uploading the template to the CloudFormation console.

### Using the CLI

**Temporal CLI**

Run the `temporal cloud namespace export s3 create` command and provide the following information:

- `--namespace`: The Namespace to configure export for.
- `--sink-name`: The name of the export sink.
- `--role-arn`: The ARN of the AWS IAM role to use for the CloudFormation stack that has write permission to the S3 bucket.
- `--bucket-name`: The name of the AWS S3 bucket.
- `--region`: The AWS region the S3 bucket is in.
- `--disable-standalone-activity-export`: (optional) Export Workflow Executions only. Standalone Activity Executions are exported by default.

For example:

```command
temporal cloud namespace export s3 create \
  --namespace "your-namespace.your-account" \
  --sink-name "your-sink-name" \
  --role-arn "arn:aws:iam::123456789012:role/test-sink" \
  --bucket-name "your-aws-s3-bucket-name" \
  --region "us-east-1"
```

Retrieve the status of this command by running the `temporal cloud namespace export get` command.

For example:

```command
temporal cloud namespace export get \
  --namespace "your-namespace.your-account" \
  --sink-name "your-sink-name"
```

To stop exporting Standalone Activity Executions from an existing sink, update the sink:

```command
temporal cloud namespace export s3 update \
  --namespace "your-namespace.your-account" \
  --sink-name "your-sink-name" \
  --disable-standalone-activity-export
```

To resume, run the same command with `--disable-standalone-activity-export=false`.

**tcld**

`tcld` doesn't support disabling Standalone Activity export. Use the Temporal CLI instead.

Run the `tcld namespace export s3 create` command and provide the following information:

- `--namespace`: The Namespace to configure export for.
- `--sink-name`: The name of the export sink.
- `--role-arn`: The ARN of the AWS IAM role to use for the CloudFormation stack that has write permission to the S3 bucket.
- `--s3-bucket-name`: The name of the AWS S3 bucket.

For example:

```command
tcld namespace export s3 create --namespace "your-namespace.your-account" --sink-name "your-sink-name" --role-arn "arn:aws:iam::123456789012:role/test-sink" --s3-bucket-name "your-aws-s3-bucket-name"
```

Retrieve the status of this command by running the `tcld namespace export s3 get` command.

For example:

```command
tcld namespace export s3 get --namespace "your-namespace.your-account" --sink-name "your-sink-name"
```

The following is an example of the output:

```json
{
  "name": "your-sink-name",
  "resourceVersion": "a6442895-1c07-4da4-aaca-58d57d338345",
  "state": "Active",
  "spec": {
    "name": "your-sink-name",
    "enabled": true,
    "destinationType": "S3",
    "s3Sink": {
      "roleName": "your-export-test",
      "bucketName": "your-export-test",
      "region": "us-east-1",
      "kmsArn": "",
      "awsAccountId": "123456789012"
    }
  },
  "health": "Ok",
  "errorMessage": "",
  "latestDataExportTime": "0001-01-01T00:00:00Z",
  "lastHealthCheckTime": "2023-08-14T21:30:02Z"
}
```

### Using `terraform`

See the [terraform export support](https://registry.terraform.io/providers/temporalio/temporalcloud/latest/docs/resources/namespace_export_sink) for setup instructions.
To export Workflow Executions only, set `filter.disable_standalone_activity_export = true` on the `temporalcloud_namespace_export_sink` resource.

### Next steps

- [Verify export setup](/cloud/export#verify)
- [Monitor export progress](/cloud/export#monitor)
- [Work with exported files](/cloud/export#working-with-exported-files)
