Skip to content

Reuse what you already have ​

In a company, an AWS account rarely starts empty. A landing zone provides the network, the identity pool and the certificates, and a platform team owns the shared database or the Kubernetes cluster. This is called a brownfield deployment. You do not want n8n to create a second VPC, so you tell it which resources exist.

This guide shows the three kinds a resource can have, how to fill an existing block, and what the tool still creates. The kinds are defined in concepts.

Three kinds ​

KindMeaningExample
createThe tool builds the resource and owns itA new VPC, a new Aurora cluster
existingThe resource is in your account, and you give its identifiersA VPC id and its subnets
externalThe resource is outside the control of the tool, possibly outside AWSA PostgreSQL host in another network, a shared Redis

A resource that the tool does not create is never deleted by destroy. A key that belongs to another kind is an error (S1).

What you can reuse ​

SectionExisting form
network.vpckind: existing, id, availability_zones, private_subnets, and public_subnets when the ingress is public
runtime.ecs.cluster{kind: existing, name: shared-apps}, which does not combine with EC2 capacity (T17)
runtime.eks.cluster{kind: existing, name: ...}, see the EKS guide
databasekind: external with host, credentials, ssl and a security_group_id
queuekind: external with host, tls and auth
storage.bucket{kind: existing, name: ..., prefix: n8n/, kms_key_arn: ...}
ingress.hosted_zone, ingress.certificateAn existing zone, and the ARN of an ACM certificate
auth.cognitokind: existing with the pool id, client id and domain
aws.kms_keykind: existing with an ARN
n8n.encryption_key{kind: existing, secret: ...}

Every existing block must be complete: an existing VPC needs its subnets, and a database created in it needs at least two private subnets in different availability zones.

An example ​

yaml
network:
  vpc:
    kind: existing
    id: vpc-0a1b2c3d4e5f60718
    availability_zones: [eu-west-1a, eu-west-1b]
    private_subnets: [subnet-0aaa1111, subnet-0bbb2222]
database:
  kind: external
  host: shared-aurora.cluster-abcdefghijkl.eu-west-1.rds.amazonaws.com
  name: n8n
  credentials: {secret: rds/shared-aurora/n8n}
  security_group_id: sg-0123456789abcdef0

For an external database, the secret holds a JSON with username and password, and the tool adds an ingress rule on security_group_id for the n8n tasks. The existing-landing-zone sample reuses a VPC, a cluster, a database, a bucket prefix, a Cognito pool and a certificate, and creates only the n8n services and the cache.

Permissions boundary ​

Landing zones often require a permissions boundary on every role. Set aws.permissions_boundary to its ARN, and the tool applies it to every IAM role it creates.

Things to remember ​

  • The tool cannot edit what it does not own. For an external database, you open the network path and create the user.
  • A secret that you provide for the encryption key is not replicated by the cross-region backup (T19). Replicate it yourself.
  • A shared bucket needs a prefix, and a lifecycle rule on the whole bucket would delete execution data. The tool sets its lifecycle on workflows/ only for buckets it creates.