Learning resourcesReviewed · n8n

Maintain and tear down the AWS deployment

This guide helps developers and infrastructure operators maintain n8n on AWS with Terraform, but the module's default settings favor easy teardown over preserving data.

Researched 24 Nov 2026

In short.

This guide explains AWS maintenance and teardown for developers operating n8n with Terraform, but preserving encrypted backups requires explicit protection for both the data and its keys. It covers existing KMS keys, PostgreSQL certificate verification, deletion settings and the seven-day key-deletion window. The documented defaults leave database certificate verification disabled and favor resource deletion. Deployment, recovery and teardown behavior remain unverified.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete selected documentation page at [https://docs.n8n.io/deploy/host-n8n/install-options/use-a-cloud-provider/deploy-to-aws-with-terraform/maintain-and-tear-down.md], including its configuration examples, deletion defaults and encryption warnings. The linked module, upgrade guide, destroy checklist, related deployment pages, documentation index and MCP server are excluded. No configuration or commands were executed; deployment, recovery and teardown behavior remain unverified.

The overview

Identity

This n8n documentation page explains maintenance and deletion settings in the terraform-aws-n8n module. Its original address is [https://docs.n8n.io/deploy/host-n8n/install-options/use-a-cloud-provider/deploy-to-aws-with-terraform/maintain-and-tear-down.md].

The module is linked at [https://github.com/n8n-io/terraform-aws-n8n]. The page focuses on encryption keys, database connections, retained backups and deployment teardown.

Assessment

The guide is useful for reviewing an existing deployment before production use, incident recovery or decommissioning. Its strongest contribution is explaining interactions that individual settings can hide: retained backups still need usable encryption keys, and destroy uses applied Terraform state.

It provides concrete configuration guidance, but does not establish that a particular deployment is secure, recoverable or ready for production.

Users

The intended readers are developers, infrastructure operators and security teams responsible for n8n on AWS through this Terraform module. It is particularly relevant when a central team controls encryption keys or backups must survive infrastructure deletion.

Beginners can use it to understand the risks, but following the examples assumes familiarity with Terraform configuration, AWS resource identifiers and encryption-key policies.

Capabilities

The page explains how to supply existing KMS encryption keys for RDS and S3, configure encryption for PostgreSQL CloudWatch logs, enable database certificate verification, recover a key awaiting deletion and change deletion protections.

It also identifies four settings for protecting production data and explains why changing a configured encryption key does not re-encrypt existing data.

Using it

Requirements

The examples assume a terraform-aws-n8n deployment. In practice, following them requires control over its Terraform configuration and state, plus access to the relevant AWS key settings. Existing keys require their Amazon Resource Names, or ARNs; certificate verification requires the AWS RDS CA bundle.

The page does not specify Terraform, AWS provider or module versions, a complete permissions policy, or installation prerequisites.

Mechanism

The database connection is encrypted by default, but DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=false leaves the server's identity unverified. Supplying the AWS certificate-authority bundle allows verification; the module mounts the bundle read-only in every n8n pod and sets DB_POSTGRESDB_SSL_CA_FILE.

RDS can use a customer key through a grant. CloudWatch Logs additionally requires the regional logs.<region>.amazonaws.com principal in the key policy, with kms:Encrypt, kms:Decrypt, kms:ReEncrypt*, kms:GenerateDataKey* and kms:DescribeKey permissions. Without that statement, the page says the postgresql log group falls back to CloudWatch's own managed key.

Setup

For an existing database key, set create_db_kms_key=false together with db_kms_key_arn. For an existing S3 key, pair create_s3_kms_key=false with s3_kms_key_arn. The boolean alone stops key creation; an ARN alone is ignored.

For verified PostgreSQL TLS, obtain the combined CA bundle from [https://truststore.pki.rds.amazonaws.com], supply it through db_postgresdb_ssl_ca_pem and set db_postgresdb_ssl_reject_unauthorized=true. For database-log encryption with your key, configure the required key policy, db_logs_kms_key_enabled=true and db_logs_kms_key_arn.

Example

For a production deployment, the page recommends db_deletion_protection=true, db_skip_final_snapshot=false with db_final_snapshot_identifier, db_delete_automated_backups=false and s3_force_destroy=false. Their documented defaults are false, true, true and true respectively.

The page states that all four changes update existing resources without forcing replacement. Apply the changes before any destroy operation: editing a .tfvars file and immediately destroying still uses the old values in Terraform state.

Assessment & evidence

Limitations

The module schedules its managed KMS keys for deletion seven days after destroy. A key becomes unusable immediately when deletion is scheduled, so retained encrypted RDS snapshots and S3 objects cannot be decrypted while it is in PendingDeletion.

Changing the configured key does not re-encrypt existing data. The page links to fuller upgrade and destroy instructions, but does not include a complete recovery procedure or demonstrate a successful deployment, restore or teardown.

Reasoning

The operational value comes from treating data retention, key retention and applied configuration as connected requirements. Keeping a snapshot cannot preserve recovery if its key becomes unusable; editing protection settings cannot affect destroy until those changes reach Terraform state.

The TLS guidance addresses another distinction: encryption protects traffic, while certificate verification checks the identity of the database server.

Alternatives

The documented encryption options are module-managed KMS keys and existing keys, such as keys controlled by a central security team. For backups that must survive destroy, the page recommends a retained key managed outside the module.

Other hosting platforms, Terraform modules and managed hosting services are not compared.

Evidence

The page supplies Terraform examples, two AWS CLI commands, a four-setting deletion table and specific warnings about key policies and backup recovery. These document intended behavior; runtime correctness and recovery outcomes are unverified.

Linked repository files and documentation pages are outside the available evidence.

Access & freshness

Costs

The page provides no prices or estimates for AWS infrastructure, encryption keys, retained snapshots, backups or S3 storage. Operating, retention and recovery costs are unknown. Any applicable n8n licensing costs are also unspecified.

Rights

The page does not state licensing or redistribution terms for its documentation, configuration examples or linked module. Reuse and redistribution permissions cannot be established from this page.

Freshness

The source was captured on 24 November 2026 at 16:18:03.199 UTC. The page supplies no publication date, last-updated date or module release identifier. Compatibility with a particular installed module version is unknown.

Actions

Before teardown, decide whether encrypted backups must remain usable. The page advises retaining a key outside the module, copying RDS snapshots under that key, and re-encrypting or copying existing S3 objects before destroying the deployment.

If a key is still awaiting deletion after a completed destroy, the documented recovery sequence is to cancel deletion with aws kms cancel-key-deletion, enable it with aws kms enable-key, and import it back into Terraform state before reapplying. Both AWS commands require --key-id. The page does not supply the Terraform import command.

Evidence for this report

selected-page.txtselected · checked 2026-11-24