Documentation Index
Fetch the complete documentation index at: https://docs.promptlayer.com/llms.txt
Use this file to discover all available pages before exploring further.
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:| Item | Purpose |
|---|---|
| OpenTofu configuration | Creates the AWS infrastructure and Kubernetes add-ons. |
| Example tfvars files | Templates for infra.tfvars, kubernetes.tfvars, and opensearch.tfvars. |
| Helm values files | Configuration for the PromptLayer application charts. |
| Release manifest | The chart versions, release names, namespaces, and values files to use. |
| Registry credentials | Access to PromptLayer’s private chart and image registry. |
Before you begin
Make sure you have:| Requirement | Notes |
|---|---|
| Enterprise license | See Self-Hosted PromptLayer for licensing and support. |
| OpenTofu | Version 1.10.0 or newer. |
| AWS CLI | v2 is recommended. aws sts get-caller-identity must succeed. |
| AWS IAM access | Permission to create and update VPC, EKS, RDS, ElastiCache, IAM, S3, Route53, Secrets Manager, and related resources. |
| Helm | A Helm CLI version that supports OCI registries. |
| kubectl | Used for verification after EKS is created. |
| Domain | A Route53 hosted zone for the PromptLayer hostname and wildcard certificate. |
| Deployment package | The environment-specific files from PromptLayer. |
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:| Area | Values to confirm |
|---|---|
| AWS account | Account ID, AWS region, AWS partition if not commercial AWS, and the IAM role or user that will run OpenTofu. |
| Naming | Project name, environment name, resource tags, cost center, and owner tags. |
| Networking | VPC CIDR, availability zones, public subnet CIDRs, private subnet CIDRs, NAT gateway strategy, and EKS API access CIDRs. |
| DNS and TLS | Domain name, Route53 hosted zone ID, certificate email, wildcard DNS names, and whether external and internal ingress should use the wildcard certificate. |
| Databases | RDS instance size, storage, Multi-AZ setting, backup retention, backup window, maintenance window, deletion protection, and optional customer-managed KMS key. |
| Cache | ElastiCache Valkey size, failover setting, Multi-AZ setting, encryption settings, and maintenance window. |
| EKS | Cluster name, Kubernetes version, node group sizes, instance types, disk sizes, logs, endpoint access, and optional KMS key for Kubernetes secrets. |
| Storage | S3 bucket names or naming prefix, encryption settings, lifecycle rules, CORS needs, and whether bucket names should include the AWS account ID. |
| IAM | Route53 zones for cert-manager and external-dns, Secrets Manager and SSM ARNs for External Secrets, KEDA scaler permissions, and application service account names. |
| OpenSearch | Admin password delivery method, replica counts, disk sizes, resources, and optional warm tier. |
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:| File | Update |
|---|---|
infra.tfvars | project_name, environment, region, tags, remote state values, VPC settings, EKS settings, RDS settings, Valkey settings, S3 bucket settings, and IRSA settings. |
kubernetes.tfvars | Remote state values, infra remote state key, storage class, cert-manager settings, Route53 settings, ingress settings, monitoring and logging settings, External Secrets settings, KEDA settings, and RDS user bootstrap settings. |
opensearch.tfvars | Remote state values, AWS region, EKS cluster name, environment, tags, OpenSearch chart versions, replicas, disk sizes, resources, and namespace. |
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.| Stage | remote_state_s3_key |
|---|---|
| Infrastructure | aws/<aws-region>/infra.tfstate |
| Kubernetes | aws/<aws-region>/kubernetes.tfstate |
| OpenSearch | aws/<aws-region>/opensearch.tfstate |
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.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: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.Log in to the registry
Use
--password-stdin so the password is not passed as a command-line argument.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
| Issue | What to check |
|---|---|
tofu init cannot read state | Confirm the generated backend.tf bucket, key, and region match the remote_state_s3_* values in the stage tfvars file. |
| OpenTofu state is locked | Another apply may be running. Use force-unlock only after confirming no other process is active. |
| AWS access denied | Confirm the AWS identity has access to the state bucket and to create or update the services used by the stage. |
| EKS API connection fails | Confirm the public API CIDR list includes the runner IP, or run from a network that can reach the private endpoint. |
| Certificate does not become ready | Check Route53 zone ID, DNS zone names, cert-manager logs, and DNS propagation. |
| Pods stay pending | Check node group sizes, taints, tolerations, storage class, and PVC events. |
| Pods restart repeatedly | Check pod logs, Events, values files, image pull credentials, database endpoints, and secret names. |
| OpenSearch pods do not schedule | Confirm the OpenSearch node groups, labels, taints, storage class, and admin password variable. |

