Skip to content

pradip-allwyn/terraform-aws-n8n

 
 

Repository files navigation

Description

This sets up a N8n cluster with two Fargate Spot instances and a ALB. It is backed by an EFS file system to store the state. The total costs are around 3 USD per month (provided your ALB is in the free tier). It does not come with SSL (optionally it can listen for SSL connections), but this would raise the cost. You can also use a service like Cloudflare to run the SSL for you.

Note: This module has been setup as a cheap and easy way to run N8n. Data is stored on a EFS volume (you must back this up yourself). We use a single instance (Fargate Spot) so it might be replaced every now and then. N8n is not ment to run stateless behind a load balancer (you will get issues with webhooks).

About ElasticScale

ElasticScale is a Solutions Architecture as a Service focusing on start-ups and scale-ups. For a fixed monthly subscription fee, we handle all your AWS workloads. Some services include:

  • Migrating existing workloads to AWS
  • Implementing the Zero Trust security model
  • Integrating DevOps principles within your organization
  • Moving to infrastructure automation (Terraform)
  • Complying with ISO27001 regulations within AWS

You can pause the subscription at any time and have direct access to certified AWS professionals.

Check out our website for more information.

ElasticScale logo

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

Name Source Version
vpc terraform-aws-modules/vpc/aws n/a

Resources

Name Type
aws_cloudwatch_log_group.logs resource
aws_ecs_cluster.ecs resource
aws_ecs_cluster_capacity_providers.main resource
aws_ecs_service.service resource
aws_ecs_task_definition.taskdef resource
aws_efs_access_point.access resource
aws_efs_file_system.main resource
aws_efs_mount_target.mount resource
aws_iam_role.executionrole resource
aws_iam_role.taskrole resource
aws_lb.main resource
aws_lb_listener.http resource
aws_lb_listener.https resource
aws_lb_target_group.ip resource
aws_security_group.alb resource
aws_security_group.efs resource
aws_security_group.n8n resource
aws_availability_zones.available data source
aws_caller_identity.current data source
aws_region.current data source

Inputs

Name Description Type Default Required
certificate_arn Certificate ARN for HTTPS support string null no
container_image Container image to use for n8n string "n8nio/n8n:1.4.0" no
desired_count Desired count of n8n tasks, be careful with this to make it more than 1 as it can cause issues with webhooks not registering properly number 1 no
fargate_type Fargate type to use for n8n (either FARGATE or FARGATE_SPOT)) string "FARGATE_SPOT" no
prefix Prefix to add to all resources string "n8n" no
url URL for n8n (default is LB url), needs a trailing slash if you specify it string null no

Outputs

Name Description
lb_dns_name Load balancer DNS name

About

Run N8n on AWS ECS Fargate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 100.0%