Export to AWS S3
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 you set up the export sink with Terraform or the CLI.
- (Optional) A KMS ARN associated with the S3 bucket.
Configure an export sink
There are multiple ways to configure an export sink: through the Temporal Cloud UI, the CLI, or terraform.
See export timing and delivery guarantees.
An export sink exports closed Workflow Executions and closed Standalone Activity Executions by default. To export Workflow Executions only, disable Standalone Activity export on the sink. See Choose which Executions to export.
Using Temporal Cloud UI
You can use the Temporal Cloud UI to configure an export sink.
The Temporal Cloud UI provides two ways to configure an export sink:
- Automated setup (recommended): The Cloud UI launches the AWS CloudFormation Console to create a stack with write permission to the S3 bucket.
- Manual setup: The Cloud UI provides a CloudFormation template for users to manually configure a CloudFormation stack.
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 an export sink using the Temporal Cloud UI.

Don't forget to click Save at the end of your setup to create the export sink.
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.
- Open the Temporal Cloud UI and navigate to the Namespace you want to configure.
- Select Configure from the Export card.
- 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.
- Select Executions to export: Standalone Activities is selected by default. Clear it to export Workflow Executions only.
- 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 select or clear Standalone Activities. Workflow export continues either way.
Manual setup
You can manually configure a CloudFormation stack using the provided template.
- Open the Temporal Cloud UI and navigate to the Namespace you want to configure.
- Select Configure from the Export card.
- 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 by uploading the template to the CloudFormation console.
Using the CLI
- Temporal CLI
- tcld
Run the temporal cloud namespace export s3 create command and provide the following information:
--namespace: The Namespace to configure the export sink 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:
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:
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:
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 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 the export sink 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:
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:
tcld namespace export s3 get --namespace "your-namespace.your-account" --sink-name "your-sink-name"
The following is an example of the output:
{
"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 for setup instructions.
To export Workflow Executions only, set filter.disable_standalone_activity_export = true on the temporalcloud_namespace_export_sink resource.