Deploy to AWS with Terraform
terraform-aws-n8n is a Terraform module that deploys a production-grade, multi-main n8n instance to AWS. It provisions an Amazon EKS cluster running n8n's Helm chart, with managed PostgreSQL (RDS), Redis (ElastiCache), and S3 for shared file storage.
This differs from the manual Kubernetes setup n8n documents elsewhere: that guide walks you through hand-written manifests for a single n8n instance. This module automates a highly available, auto-scaling deployment, and it's maintained independently by the n8n Solutions team.
Architecture
Users and inbound webhooks reach an Application Load Balancer that fronts the EKS cluster. Inside the cluster, the n8n Helm chart runs three separate deployments:
Main pods: handle leader election, the editor UI, and the REST API.
Webhook processor pods: handle inbound triggers.
Worker pods: run workflow executions, and scale on Redis queue depth using KEDA.
State lives in managed services outside the cluster: RDS PostgreSQL for workflow data, ElastiCache Redis for leader election and the worker queue, and S3 for binary data. AWS Certificate Manager (ACM) issues the TLS certificate for the load balancer.
AWS grants pods permissions (for the Load Balancer Controller, Cluster Autoscaler, EBS CSI driver, and n8n's own S3 access) through EKS Pod Identity.
Prerequisites
An n8n license key: an Enterprise license for the default multi-main topology, or a Business license if you set
n8n_main_hpa_min_replicas = 1.A pre-existing VPC with public and private subnets tagged for EKS and ALB use. The module doesn't create a VPC. See Customize the AWS infrastructure.
Terraform CLI 1.11 or later, with the
aws,kubernetes, andhelmproviders configured.A DNS option: either a Route 53 hosted zone (
route53_zone_id), which lets the module issue the ACM certificate and manage the DNS record itself, or a pre-validated certificate from another provider (certificate_arn).
Usage
For a step-by-step walkthrough that takes you from an empty folder to a running instance, see Deploy your first n8n instance on AWS. The configuration below is the minimum set of inputs:
Pass sensitive values such as n8n_license_key from a secrets manager, and store Terraform state in an encrypted, access-controlled backend because the module writes the key into the Helm release. Never hardcode the key in a .tfvars file you commit to version control.
Choose a starting size
The module ships three sizing examples. Use one as your starting point, then tune node type, count, and database size from there.
Target scale
Development or small team
~5-15M executions/day
~50-60M+ executions/day
Node type
t3.xlarge
m6i.2xlarge
m7i.4xlarge
Nodes (min/max)
3/6
5/15
10/50
Database
RDS db.t3.small
RDS db.m6g.2xlarge
Aurora PostgreSQL I/O-Optimized
Redis
cache.t3.medium
cache.r6g.large
cache.r6g.large
Estimated cost/month (on-demand)
~$440
~$2,000
~$21,000+
Two topology variants are also available as examples: split-ingress (see Customize the AWS infrastructure) and worker-pools, an alpha n8n feature that runs separate labelled worker pools.
Support
This module is open source, maintained by the n8n Solutions team independently of n8n's Enterprise support offering. Report bugs or request features on GitHub issues; the maintainers triage on a best-effort basis, with no SLA. For general n8n questions unrelated to the module, use the n8n community forum.
In this section
Deploy your first n8n instance on AWS: a step-by-step walkthrough, from an empty folder to a running instance.
Scale and run at high availability on AWS: configure multi-main, worker autoscaling, and Redis high availability.
Configure Enterprise features on AWS: wire up S3 execution data, Prometheus metrics, OpenTelemetry tracing, log streaming, and external secrets.
Customize the AWS infrastructure: bring your own VPC, database, cache, or cluster, split ingress, or use a custom n8n image.
Maintain and tear down the AWS deployment: manage encryption keys, verify database TLS, and configure deletion protection.
Related resources
Last updated
Was this helpful?