Deploy PromptLayer on AWS
Use this guide to deploy PromptLayer in your own AWS account. PromptLayer provides a deployment package with OpenTofu configuration, Helm values files, a release manifest, and registry credentials. The deployment has four phases:- Prepare AWS access and customer-specific settings.
- Provision infrastructure with OpenTofu.
- Install cluster add-ons and OpenSearch.
- Install PromptLayer Helm charts.
What PromptLayer provides
PromptLayer sends a deployment package for your environment. It includes:Before you begin
Make sure you have:OpenTofu downloads provider binaries during
tofu init. You do not install the AWS, Kubernetes, Helm, or HTTP providers separately.Gather customer inputs
Decide these values before you run OpenTofu:Prepare AWS access
Authenticate to the target AWS account and verify the identity:Prepare secrets
Create or select a Secrets Manager secret for RDS. The secret must contain the RDS master password and any database user passwords that the deployment package references. Example shape:infra.tfvars and kubernetes.tfvars.
Set the OpenSearch admin password as an environment variable before running the OpenSearch stage:
Prepare the deployment package
From the package root, create local tfvars files from the examples:Bootstrap OpenTofu state
Create a dedicated S3 bucket for OpenTofu state. The bootstrap script creates the bucket, enables versioning, blocks public access, enables SSE-S3 encryption, and writes the S3 backend config for all three AWS stages.
OpenTofu uses native S3 locking. You do not need a DynamoDB lock table.
Deploy infrastructure
The infrastructure stage creates the VPC, subnets, EKS cluster, node groups, RDS, ElastiCache Valkey, S3 buckets, security groups, and IAM roles for Kubernetes service accounts.Deploy Kubernetes add-ons
The Kubernetes stage installs cluster add-ons such as cert-manager, ingress controllers, External Secrets, KEDA, monitoring, logging, and cluster autoscaling. Run this stage in two passes so cert-manager custom resources are available before you create the issuer and wildcard certificate.1
First pass: install CRDs and add-ons
In the existing
cert_manager object in kubernetes.tfvars, keep cluster_issuer.enabled and wildcard_certificate.enabled set to false.Then apply:2
Second pass: enable certificates and TLS
In
kubernetes.tfvars, set cert_manager.cluster_issuer.enabled and cert_manager.wildcard_certificate.enabled to true.For each ingress controller that should use the wildcard certificate, set enable_default_tls_from_wildcard_certificate and enable_wildcard_tls_from_wildcard_certificate to true.Apply again:Deploy OpenSearch
Deploy OpenSearch after the EKS cluster and Kubernetes add-ons are ready. Before applying:- Set
eks_cluster_nameinopensearch.tfvarsto the cluster name from the infrastructure output. - Set
aws_region,environment,project_name, anddefault_tags. - Confirm the OpenSearch node groups exist and use the labels and taints required by the deployment package.
- Export
TF_VAR_opensearch_initial_admin_password.
Install PromptLayer charts
Install the PromptLayer application charts after infrastructure, Kubernetes add-ons, and OpenSearch are ready. Use the release names, namespaces, values files, and chart versions from your release manifest. Run Helm from the directory that contains the values files.1
Log in to the registry
Use
--password-stdin so the password is not passed as a command-line argument.2
Install sandbox-runtimes
3
Install sandboxes-api
4
Install promptlayer
Verify PromptLayer
Check the Helm releases:Running or Completed status. Ingress hostnames should resolve through the DNS records created for the deployment.
Upgrade a release
For chart upgrades, use the chart version and values file from the release manifest:Troubleshooting
If you need help with registry access, values files, or deployment issues, contact our enterprise team.

