Set up the data plane
Deploy the Braintrust data plane infrastructure in your AWS account.Braintrust recommends deploying in a dedicated AWS account. AWS enforces account-level Lambda concurrency limits, and since Braintrust’s API runs on Lambda, sharing an account with other workloads can lead to throttling and service disruptions. A dedicated account also aligns with AWS best practices for workload isolation and security.
1
Configure the Terraform module
The Braintrust Terraform module contains all the necessary resources for a self-hosted Braintrust data plane.
-
Copy the entire contents of the
examples/braintrust-data-planedirectory from the terraform-aws-braintrust-data-plane repository into your own repository. -
In
provider.tf, configure your AWS account and region. Supported regions:us-east-1,us-east-2,us-west-2,eu-west-1,ca-central-1, andap-southeast-2. If you require support for a different region, contact Braintrust. -
In
terraform.tf, set up your remote backend (typically S3 and DynamoDB). -
In
main.tf, customize the Braintrust deployment settings. The defaults are for suitable for a large production-sized deployment. Adjust them based on your needs, but keep in mind the hardware requirements.
2
Initialize AWS account
Braintrust recommends a dedicated AWS account for your Braintrust deployment.If you’re using a new AWS account, run the
create-service-linked-roles.sh script to create all necessary IAM service-linked roles for the deployment:3
Configure Brainstore license
Your deployment includes Brainstore, a high-performance query engine for real-time trace ingestion.
Brainstore requires a license key.
- In the Braintrust UI, go to Settings > Data plane.
-
Copy your Brainstore license.
If you don’t see your data plane configuration, contact Braintrust to enable self-hosting.
-
Pass the key to Terraform in one of the following ways:
- Set
TF_VAR_brainstore_license_key=your-keyin your environment. - Pass it via command line:
terraform apply -var 'brainstore_license_key=your-key'. - Add it to an uncommitted
terraform.tfvarsor.auto.tfvarsfile. - Store it in AWS Secrets Manager and load it at runtime using the
aws_secretsmanager_secret_version_sourcedata source.
- Set
4
Deploy the module
Initialize and apply the Terraform configuration:This will create all necessary AWS resources including:
- Two isolated VPCs:
- Main VPC: Hosts Braintrust services (API, database, Redis, Brainstore)
- Quarantine VPC: Isolated environment where user-defined functions execute
- Lambda functions for the Braintrust API
- Public CloudFront endpoint and API Gateway
- EC2 Auto-scaling group for Brainstore
- PostgreSQL database, Redis cache, and S3 buckets
- KMS key for encryption
5
Get your API URL
After the deployment completes, get your API URL from the Terraform outputs:You should see output similar to:Save this URL - you’ll need it to configure your Braintrust organization.
Configure your organization
Connect your Braintrust organization to your newly deployed data plane.1
Point your organization to your data plane
- In the Braintrust UI, go to Settings > Data plane.
- In API URL area, select Edit.
- Enter the API URL from the last step.
- Leave the other fields blank.
- Select Save.
2
Verify the connection
The UI will automatically test the connection to your new data plane. Verify that the ping to each endpoint is successful.

Update the deployment
Runterraform apply to update your deployment. This will apply any infrastructure changes and update the Lambda functions while preserving your data.
?ref=<version> to the module source:
Debug issues
If you encounter issues, you can use thedump-logs.sh script to collect logs:
bt-sandbox deployment, run:
logs-<deployment_name> directory, which you can share with the Braintrust team for debugging.
Customize the deployment
Use an existing VPC
To integrate with an existing VPC, setcreate_vpc = false and provide your existing VPC identifiers. Your VPC must meet these prerequisites:
- Minimum 3 private subnets across different availability zones
- At least 1 public subnet
- Properly configured internet and NAT gateways with route tables
services, database, and redis modules.
Use custom tags
To apply custom tags to all resources, pass thecustom_tags parameter to the Braintrust module:
BraintrustDeploymentName tag across all resources.
Use the
custom_tags parameter instead of the AWS provider’s default_tags configuration. Due to a Terraform limitation, default_tags are not applied to resources that use launch templates, such as Brainstore instances.Redis instance sizing
VPC connectivity
To connect Braintrust’s VPC to other internal resources (like an LLM gateway), use one of the following approaches:- Create a VPC Endpoint Service for your internal resource, then create a VPC Interface Endpoint inside of the Braintrust “Quarantine” VPC
- Set up VPC peering with the Braintrust “Quarantine” VPC