Skip to main content

NodeRED CloudRun Module — Configuration Guide

Node-RED is a leading open-source flow-based programming tool designed for wiring together IoT devices, APIs, and online services through a browser-based visual editor. This module deploys Node-RED on Google Cloud Run Gen2 with NFS-backed persistent flow storage and optional Redis context storage.

NodeRED CloudRun is a wrapper module built on top of App CloudRun. It delegates all GCP infrastructure provisioning to App CloudRun (Cloud Run service, networking, Secret Manager, GCS, NFS, CI/CD) and uses a NodeRED Common sub-module to supply Node-RED-specific application configuration. The NodeRED Common outputs feed into App CloudRun's application_config, module_storage_buckets, and scripts_dir inputs.

This guide documents variables that are unique to NodeRED CloudRun or that have Node-RED-specific defaults differing from the App CloudRun base module. For full documentation of variables with identical semantics, refer to the App_CloudRun Configuration Guide.


§1 · Module Overview

What NodeRED CloudRun provides

  • A Node-RED container (prebuilt nodered/node-red image from Docker Hub, enable_image_mirroring = true) deployed on Cloud Run Gen2, listening on port 1880.
  • NFS (Cloud Filestore) enabled by default (enable_nfs = true) and mounted at /data. Node-RED stores all persistent data in /data — flows, credentials, installed nodes, and settings. NFS is the recommended backend as it survives container restarts and new deployments.
  • NODE_RED_CREDENTIAL_SECRET auto-generated by the Foundation Module and stored in Secret Manager. This secret encrypts Node-RED's stored credentials (passwords in flows). Its length is controlled by database_password_length.
  • NODE_RED_ENABLE_SAFE_MODE = "false" always injected, ensuring flows execute on startup.
  • Optional Redis for Node-RED context storage (enable_redis = false by default). When enabled, Redis allows context data to persist across restarts and be shared between instances.
  • Scale-to-zero support (min_instance_count = 0). Because Node-RED flows are stateful, max_instance_count defaults to 1 — increase only if using Redis-backed external context storage.
  • No Cloud SQL is required or used. enable_cloudsql_volume defaults to false.

Key differences from App CloudRun defaults

FeatureApp CloudRun defaultNodeRED CloudRun default
container_port80801880
cpu_limit"1000m""1000m"
memory_limit"512Mi""1Gi"
min_instance_count00
max_instance_count11
enable_nfsfalsetrue
nfs_mount_path"/mnt/nfs""/data"
enable_cloudsql_volumefalsefalse (unused)
enable_redisfalsefalse
enable_image_mirroringtruetrue
Health probe path/healthz/
Database backendvariesnone ("NONE")

§2 · IAM & Project Identity

VariableDefaultDescription
project_id(required)GCP project into which all resources are deployed.
tenant_deployment_id"demo"Short suffix appended to resource names to allow multiple deployments in the same project.
resource_creator_identity"rad-module-creator@tec-rad-ui-2b65.iam.gserviceaccount.com"Service account used by Terraform.
support_users[]Email addresses granted IAM access and added to monitoring alert channels.
resource_labels{}Labels applied to all module-managed resources.
module_description(Node-RED Cloud Run description)Platform UI description.
module_documentation"https://docs.radmodules.dev/docs/modules/NodeRED_CloudRun"External documentation URL.
module_dependency["Services GCP"]Platform modules that must be deployed first.
module_services(Cloud Run, NFS, GCS, etc.)GCP services used by this module.
credit_cost50Platform credits consumed on deployment.
require_credit_purchasesfalseEnforces credit balance check.
enable_purgetruePermits full resource deletion on destroy.
public_accesstrueVisibility to all platform users.
deployment_id""Optional fixed deployment ID. Auto-generated when blank.

§3 · Core Service Configuration

§3.A · Application Identity

VariableDefaultDescription
application_name"nodered"Base name for the Cloud Run service, Artifact Registry repo, Secret Manager secrets, and GCS buckets. Do not change after initial deployment — changing it forces resource recreation.
display_name"Node-RED"Human-readable name in the platform UI and Cloud Run console.
application_version"latest"Container image version tag. Maps to the nodered/node-red Docker Hub tag (e.g. "4.0.9", "3.1.14", "latest").

§3.B · Resource Sizing & Runtime

VariableDefaultDescription
deploy_applicationtrueSet false to provision infrastructure without deploying the container.
cpu_limit"1000m"CPU limit per container instance. Node-RED is lightweight; 1 vCPU is sufficient for most deployments.
memory_limit"1Gi"Memory limit per container instance. Node-RED requires a minimum of 256Mi; 512Mi–1Gi is recommended.
min_instance_count0Minimum live instances. 0 enables scale-to-zero. Set to 1 to keep Node-RED always warm and avoid cold-start delays.
max_instance_count1Maximum concurrent instances. Keep at 1 unless flows are stateless or Redis-backed context storage is in use.
execution_environment"gen2"Cloud Run generation. Must be "gen2" for NFS volume mounts to function.
timeout_seconds300Maximum request duration before a 504 is returned.
cpu_always_allocatedfalseWhen false, CPU is throttled when Node-RED is idle — reducing cost. Set true only if background tasks require continuous CPU.
enable_image_mirroringtrueMirrors nodered/node-red into Artifact Registry to avoid Docker Hub rate limits.
traffic_split[]Allocates traffic across Cloud Run revisions for canary/blue-green deployments. All entries must sum to 100.
max_revisions_to_retain7Maximum Cloud Run revisions kept after each deployment. Set to 0 to disable pruning.
container_protocol"http1"HTTP protocol version. Valid values: "http1", "h2c".
service_annotations{}Custom annotations applied to the Cloud Run service resource.
service_labels{}Custom labels applied to the Cloud Run service resource.

§3.C · Environment Variables & Secrets

The following variable is always injected automatically and must not be set manually in environment_variables:

  • NODE_RED_CREDENTIAL_SECRET — auto-generated by App CloudRun using database_password_length.

Do not set in environment_variables: NODE_RED_CREDENTIAL_SECRET.

VariableDefaultDescription
environment_variables{}Plain-text key/value pairs injected into the Cloud Run revision. Use for Node-RED configuration such as NODE_RED_ENABLE_PROJECTS = "true" or NODE_OPTIONS = "--max-old-space-size=256".
secret_environment_variables{}Map of env var name → Secret Manager secret name. Resolved at runtime; plaintext never stored in Terraform state.
secret_propagation_delay30Seconds to wait after secret creation before dependent operations proceed.
secret_rotation_period"2592000s"Rotation notification period (30 days). Set null to disable. Must use "Ns" format.

§3.D · Networking

VariableDefaultDescription
ingress_settings"all"Controls which traffic sources can reach the Cloud Run service. "all" for public internet, "internal" for VPC-only, or "internal-and-cloud-load-balancing".
vpc_egress_setting"PRIVATE_RANGES_ONLY"Routes only RFC 1918 traffic via VPC. Set "ALL_TRAFFIC" for strict egress control or on-premises connectivity.
cloudsql_volume_mount_path"/cloudsql"Not used by Node-RED. Kept for API compatibility.
container_protocol"http1"HTTP protocol version.

IAP and Node-RED: Enabling enable_iap = true adds Google identity authentication in front of the Cloud Run URL. This is recommended for production — the Node-RED editor exposes full flow editing and credential management and should not be left publicly accessible without authentication.

§3.E · Initialization & Bootstrap

VariableDefaultDescription
initialization_jobs[]Cloud Run jobs executed once during deployment. Node-RED requires no initialization jobs — use for custom flow imports or palette installations.
cron_jobs[]Recurring Cloud Run jobs triggered by Cloud Scheduler. Use for periodic flow exports or maintenance tasks.

§4 · Advanced Security

§4.A · Credential Secret Management

NODE_RED_CREDENTIAL_SECRET is auto-generated by App CloudRun using a random password of database_password_length characters. This secret encrypts all credentials stored in Node-RED flows (passwords, API keys). Back up this secret value before destroying the module — flows with encrypted credentials cannot be restored without the original key.

VariableDefaultDescription
database_password_length32Length of the auto-generated NODE_RED_CREDENTIAL_SECRET. Valid range: 16–64.
enable_auto_password_rotationfalseAutomates credential secret rotation via Cloud Run + Eventarc.
rotation_propagation_delay_sec90Seconds to wait after rotation before Cloud Run restarts to pick up the new value.
secret_rotation_period"2592000s"Duration between Secret Manager rotation notifications (30 days).
secret_propagation_delay30Seconds to wait after secret creation before dependent operations proceed.

§4.B · Identity-Aware Proxy (IAP)

VariableDefaultDescription
enable_iapfalseEnables Cloud Run native IAP. Recommended for production Node-RED deployments to prevent unauthorised flow access.
iap_authorized_users[]Individual users or service accounts. Format: "user:email@example.com".
iap_authorized_groups[]Google Groups. Format: "group:name@example.com".

§4.C · Cloud Armor & CDN

VariableDefaultDescription
enable_cloud_armorfalseEnables Cloud Armor WAF + Global HTTPS Load Balancer. When enabled, configure application_domains.
application_domains[]Custom domain names. Google-managed SSL certificates provisioned automatically. DNS must resolve before cert provisioning.
enable_cdnfalseEnables Cloud CDN. Only active when enable_cloud_armor = true.
admin_ip_ranges[]CIDR ranges for administrative access bypass.

§4.D · VPC Service Controls

VariableDefaultDescription
enable_vpc_scfalseRestricts GCP API access to a VPC-SC perimeter.
vpc_cidr_ranges[]VPC subnet CIDR ranges for the network access level. Auto-discovered when empty.
vpc_sc_dry_runtrueWhen true, violations are logged but not blocked. Set false to enforce.
organization_id""GCP Organization ID for Access Context Manager. Auto-discovered when empty.
enable_audit_loggingfalseEnables detailed Cloud Audit Logs.

§4.E · Binary Authorization

VariableDefaultDescription
enable_binary_authorizationfalseEnforces Binary Authorization attestation policy. Requires a policy and attestor pre-configured in the project.

§5 · Traffic & Ingress

§5.A · Ingress Controls

VariableDefaultOptionsDescription
ingress_settings"all"all / internal / internal-and-cloud-load-balancingControls which traffic sources reach the service.
vpc_egress_setting"PRIVATE_RANGES_ONLY"ALL_TRAFFIC / PRIVATE_RANGES_ONLYControls VPC routing for outbound traffic.

§5.B · Traffic Management

VariableDefaultDescription
traffic_split[]Allocates traffic across Cloud Run revisions. All entries must sum to exactly 100. Each entry requires type and percent; revision is required when type = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION".
max_revisions_to_retain7Maximum number of Cloud Run revisions to keep after deployment. 0–100.

§6 · CI/CD Integration

§6.A · GitHub & Cloud Build

Node-RED uses the prebuilt Docker Hub image (enable_image_mirroring = true). No custom Dockerfile build is required unless extending the base image.

VariableDefaultDescription
enable_cicd_triggerfalseCreates a Cloud Build trigger that builds and deploys on push to the configured branch.
github_repository_url""Full HTTPS URL of the GitHub repository. Required when enable_cicd_trigger = true.
github_token""GitHub PAT for repository authentication. Sensitive.
github_app_installation_id""Cloud Build GitHub App installation ID. Alternative to PAT for organisation repositories.
cicd_trigger_config{ branch_pattern = "^main$" }Controls branch filter, included/ignored paths, trigger name, and build substitutions.

§6.B · Cloud Deploy Pipelines

VariableDefaultDescription
enable_cloud_deployfalseSwitches to a Cloud Deploy pipeline with defined promotion stages. Requires enable_cicd_trigger = true.
cloud_deploy_stages[dev, staging, prod(approval)]Ordered promotion stages with optional manual approval gates.

§7 · Reliability & Data

§7.A · Health Probes

Node-RED responds to HTTP GET on / with the editor UI. This path is used for both startup and liveness probes. A 30-second initial delay is sufficient as Node-RED starts quickly.

VariableDefaultDescription
startup_probe{ enabled=true, type="HTTP", path="/", initial_delay_seconds=30, timeout_seconds=5, period_seconds=10, failure_threshold=3 }Startup probe. Checks the Node-RED editor UI path.
liveness_probe{ enabled=true, type="HTTP", path="/", initial_delay_seconds=30, timeout_seconds=5, period_seconds=30, failure_threshold=3 }Liveness probe. Restarts the container if the editor is unresponsive.
uptime_check_config{ enabled=true, path="/", check_interval="60s", timeout="10s" }Cloud Monitoring uptime check from global locations.
alert_policies[]List of metric-threshold alert policies. Each entry requires name, metric_type, comparison, threshold_value, duration_seconds.

§7.B · Storage (NFS & GCS)

VariableDefaultDescription
enable_nfstrueProvisions a Cloud Filestore NFS instance and mounts it at nfs_mount_path. Node-RED stores all persistent data (flows, credentials, installed nodes) in /data — NFS is the recommended backend. Requires execution_environment = "gen2".
nfs_mount_path"/data"Container path for the NFS volume. Must match Node-RED's data directory.
nfs_instance_name""Name of an existing NFS GCE VM. Leave empty to auto-discover or create a new one.
nfs_instance_base_name"app-nfs"Base name for the inline NFS GCE VM when creating a new instance.
create_cloud_storagetrueControls whether the module provisions the GCS buckets in storage_buckets.
storage_buckets[{ name_suffix = "data" }]GCS buckets to provision. The NodeRED Common sub-module adds a "nodered-storage" bucket via module_storage_buckets.
gcs_volumes[]GCS buckets mounted as GCS Fuse volumes inside the container. Requires execution_environment = "gen2".
manage_storage_kms_iamfalseCreates a CMEK KMS keyring and enables CMEK encryption on all storage buckets.
enable_artifact_registry_cmekfalseEnables CMEK encryption for the Artifact Registry repository.

§7.C · Backup & Recovery

VariableDefaultDescription
backup_schedule"0 2 * * *"Cron expression (UTC) for the automated NFS backup job. Leave empty to disable.
backup_retention_days7Days to retain backup files in GCS before automatic deletion.
enable_backup_importfalseTriggers a one-time restore job during deployment. Configure backup_source and backup_uri first.
backup_source"gcs"Source for backup import: "gcs" (full GCS URI) or "gdrive" (Google Drive file).
backup_uri""Full GCS URI of the backup file (e.g. "gs://my-bucket/backups/nodered.tar"). Mapped to backup_file in App CloudRun.
backup_format"tar"Format of the backup file. Accepted: tar, gz, sql, etc.

§8 · Integrations

§8.A · Redis (Context Storage)

Redis allows Node-RED to store flow context data externally, enabling it to persist across restarts and (optionally) be shared between multiple instances. When enable_redis = true and redis_host = "", configure redis_host explicitly to point at a Redis or Cloud Memorystore instance. Unlike N8N, there is no automatic NFS-server-IP fallback for redis_host — the validation guard (validation.tf) enforces that at least one of redis_host or enable_nfs is set when enable_redis = true.

VariableDefaultDescription
enable_redisfalseEnables Redis for Node-RED context storage. Injects REDIS_HOST and REDIS_PORT into the container.
redis_host""Redis hostname or IP address. Required when enable_redis = true (unless enable_nfs = true).
redis_port"6379"Redis TCP port (string).
redis_auth""Redis authentication password. Sensitive. Leave empty if authentication is not configured.

§8.B · Custom SQL (Unused)

Node-RED has no relational database. These variables are exposed for API compatibility with App CloudRun and have no effect:

VariableDefaultDescription
enable_custom_sql_scriptsfalseNo-op for Node-RED.
custom_sql_scripts_bucket""No-op for Node-RED.
custom_sql_scripts_path""No-op for Node-RED.
custom_sql_scripts_use_rootfalseNo-op for Node-RED.

§8.C · Artifact Registry Image Management

VariableDefaultDescription
max_images_to_retain7Maximum number of recent container images to keep in Artifact Registry. 0 disables.
delete_untagged_imagestrueAutomatically deletes untagged container images.
image_retention_days30Days after which images are eligible for age-based deletion. 0 disables.

§8.D · Observability

VariableDefaultDescription
uptime_check_config{ enabled = true, path = "/" }Cloud Monitoring uptime check configuration.
alert_policies[]List of metric-threshold alert policies.
service_annotations{}Annotations applied to the Cloud Run service resource.
service_labels{}Labels applied to the Cloud Run service.

§9 · Platform-Managed Behaviours

The following are set automatically and cannot be overridden via input variables.

Environment Variables (always injected)

VariableValue / SourceNotes
NODE_RED_ENABLE_SAFE_MODE"false"Injected by NodeRED Common; ensures flows execute on startup. Override to "true" in environment_variables if needed.
NODE_RED_CREDENTIAL_SECRETSecret Manager ref (auto-generated)Generated by App CloudRun using database_password_length. Encrypts stored credentials.

Structural Wiring

BehaviourDetail
container_image_sourceAlways "prebuilt" — forced in main.tf, not user-configurable.
container_build_configAlways { enabled = false } — forced in main.tf.
application_config{ nodered = module.nodered_app.config } — the NodeRED Common config object keyed as "nodered".
module_env_varsAlways {} — no additional Foundation-level env vars injected.
module_secret_env_varsAlways {} — no auto-generated secrets from NodeRED Common.
module_storage_bucketsmodule.nodered_app.storage_buckets — the "nodered-storage" GCS bucket defined in NodeRED Common.
scripts_dirabspath("${module.nodered_app.path}/scripts") — resolves to NodeRED Common's scripts/ directory.
backup_file mappingvar.backup_uri is mapped to backup_file in App CloudRun.
enable_cloudsql_volumeAlways false in the NodeRED Common config. User-exposed variable is kept for API compatibility.
Import blocksDisabled (imports.tf contains only a comment). Idempotency is maintained via preserved Terraform state between CI runs.

§10 · Variable Reference

Complete list of all input variables, grouped by UI section.

GroupVariableTypeDefaultUpdatable
0module_descriptionstring(long description)
0module_documentationstring"https://docs.radmodules.dev/docs/modules/NodeRED_CloudRun"
0module_dependencylist(string)["Services GCP"]
0module_serviceslist(string)(service list)
0credit_costnumber50
0require_credit_purchasesboolfalse
0enable_purgebooltrue
0public_accessbooltrue
0deployment_idstring""yes
0resource_creator_identitystring"rad-module-creator@…"yes
1project_idstring
1tenant_deployment_idstring"demo"yes
1support_userslist(string)[]yes
1resource_labelsmap(string){}yes
2application_namestring"nodered"yes
2display_namestring"Node-RED"yes
2application_versionstring"latest"yes
3deploy_applicationbooltrueyes
3cpu_limitstring"1000m"yes
3memory_limitstring"1Gi"yes
3min_instance_countnumber0yes
3max_instance_countnumber1yes
3execution_environmentstring"gen2"yes
3timeout_secondsnumber300yes
3cpu_always_allocatedboolfalseyes
3enable_cloudsql_volumeboolfalseyes
3service_annotationsmap(string){}yes
3service_labelsmap(string){}yes
3enable_image_mirroringbooltrueyes
3traffic_splitlist(object)[]yes
3max_revisions_to_retainnumber7yes
3container_protocolstring"http1"yes
3cloudsql_volume_mount_pathstring"/cloudsql"yes
4ingress_settingsstring"all"yes
4vpc_egress_settingstring"PRIVATE_RANGES_ONLY"yes
4enable_iapboolfalseyes
4iap_authorized_userslist(string)[]yes
4iap_authorized_groupslist(string)[]yes
5environment_variablesmap(string){}yes
5secret_environment_variablesmap(string){}yes
5secret_rotation_periodstring"2592000s"yes
5secret_propagation_delaynumber30yes
6backup_schedulestring"0 2 * * *"yes
6backup_retention_daysnumber7yes
6enable_backup_importboolfalseyes
6backup_sourcestring"gcs"yes
6backup_uristring""yes
6backup_formatstring"tar"yes
7enable_cicd_triggerboolfalseyes
7github_repository_urlstring""yes
7github_tokenstring""yes
7github_app_installation_idstring""yes
7cicd_trigger_configobject{ branch_pattern = "^main$" }yes
7enable_cloud_deployboolfalseyes
7cloud_deploy_stageslist(object)[dev, staging, prod(approval)]yes
7enable_binary_authorizationboolfalseyes
8enable_custom_sql_scriptsboolfalseyes
8custom_sql_scripts_bucketstring""yes
8custom_sql_scripts_pathstring""yes
8custom_sql_scripts_use_rootboolfalseyes
9enable_cloud_armorboolfalseyes
9admin_ip_rangeslist(string)[]yes
9application_domainslist(string)[]yes
9enable_cdnboolfalseyes
9max_images_to_retainnumber7yes
9delete_untagged_imagesbooltrueyes
9image_retention_daysnumber30yes
10create_cloud_storagebooltrueyes
10storage_bucketslist(object)[{ name_suffix = "data" }]yes
10enable_nfsbooltrueyes
10nfs_mount_pathstring"/data"yes
10nfs_instance_namestring""yes
10nfs_instance_base_namestring"app-nfs"yes
10gcs_volumeslist(object)[]yes
10manage_storage_kms_iamboolfalseyes
10enable_artifact_registry_cmekboolfalseyes
11database_password_lengthnumber32yes
11enable_auto_password_rotationboolfalseyes
11rotation_propagation_delay_secnumber90yes
12initialization_jobslist(object)[]yes
12cron_jobslist(object)[]yes
13startup_probeobject(HTTP /, 30s delay)yes
13liveness_probeobject(HTTP /, 30s delay)yes
13uptime_check_configobject{ enabled = true, path = "/" }yes
13alert_policieslist(object)[]yes
20enable_redisboolfalseyes
20redis_hoststring""yes
20redis_portstring"6379"yes
20redis_authstring""yes
21enable_vpc_scboolfalseyes
21vpc_cidr_rangeslist(string)[]yes
21vpc_sc_dry_runbooltrueyes
21organization_idstring""yes
21enable_audit_loggingboolfalseyes

§11 · Outputs

OutputDescription
service_urlThe Cloud Run service URL for the deployed Node-RED instance (e.g. https://appnodered<tenant><id>-<project_number>.<region>.run.app).

§12 · Configuration Examples

Basic Deployment

Deploys Node-RED with default settings. Suitable for evaluation and development.

# config/basic.tfvars
resource_creator_identity = ""
project_id = "my-project-123"
tenant_deployment_id = "basic"

Advanced Deployment

Production-grade deployment with IAP, Redis context storage, Cloud Armor, and CI/CD.

# config/advanced.tfvars
resource_creator_identity = ""
project_id = "my-project-123"
tenant_deployment_id = "prod"

application_name = "nodered"
display_name = "Node-RED"
application_version = "4.0.9"

# Scaling
cpu_limit = "1000m"
memory_limit = "1Gi"
min_instance_count = 1
max_instance_count = 1

# Redis context storage
enable_redis = true
redis_host = "10.0.0.5"
redis_port = "6379"

# Security
enable_iap = true
iap_authorized_users = ["user:admin@example.com"]
enable_cloud_armor = true
application_domains = ["nodered.example.com"]

# CI/CD
enable_cicd_trigger = true
enable_cloud_deploy = true

# Backup
backup_schedule = "0 2 * * *"
backup_retention_days = 14

# Observability
uptime_check_config = {
enabled = true
path = "/"
check_interval = "60s"
timeout = "10s"
}

alert_policies = [
{
name = "high-memory"
metric_type = "run.googleapis.com/container/memory/utilizations"
comparison = "COMPARISON_GT"
threshold_value = 0.85
duration_seconds = 300
aggregation_period = "60s"
}
]

Configuration Pitfalls & Sensible Defaults

Risk levels: Critical (data loss, full outage, security breach) — High (service unavailable or significant degradation) — Medium (degraded function or increased cost) — Low (minor impact).

VariableSensible DefaultRiskConsequence of Incorrect Value
NODE_RED_CREDENTIAL_SECRET (auto-generated, length from database_password_length)Auto-generated random string stored in Secret ManagerCriticalThis secret encrypts all flow credentials at rest in the flows_cred.json file. If this secret is rotated or changed after flows are deployed, Node-RED cannot decrypt existing credentials — all stored secrets (API keys, passwords, tokens) in flows are permanently lost and must be re-entered.
enable_auto_password_rotationfalseCriticalEnabling automatic rotation of NODE_RED_CREDENTIAL_SECRET changes the encryption key used for credentials. All existing encrypted credentials become unreadable after rotation. Only enable if you have a process to re-encrypt credentials after each rotation.
database_password_length32MediumControls the length of the auto-generated NODE_RED_CREDENTIAL_SECRET. Valid range: 16–64. Values outside this range are rejected by the built-in variable validation. Shorter lengths reduce encryption entropy.
enable_nfstrueCriticalNode-RED stores all flow definitions, credentials, and installed custom nodes in its /data directory. Without NFS (or another persistent volume), every Cloud Run restart or scale event starts Node-RED with a completely empty /data directory — all flows, nodes, and settings are lost.
nfs_mount_path"/mnt/nfs"HighNode-RED's entrypoint script configures /data to point to the NFS mount. Changing this path without a corresponding update to the Node-RED settings file causes flows to be written to the ephemeral container filesystem.
execution_environment"gen2"HighNFS mounts require the gen2 execution environment. Changing to gen1 causes NFS mount failures and container startup errors.
application_name"nodered"CriticalImmutable after first deploy. Changing it renames all GCP resources, triggers full resource recreation, and the NFS instance is disconnected from the new deployment.
min_instance_count0HighScale-to-zero causes cold starts of 10–20 seconds. More importantly, when Node-RED scales back up after idle, it must remount the NFS volume before the health check passes. If a webhook fires during this window, it will be lost. Set to 1 for production webhook workloads.
max_instance_count1HighNode-RED's flow state and context are stored locally. Running multiple instances without session affinity causes each instance to have different context state. Node-RED is not designed for active-active horizontal scaling — keep max_instance_count = 1.
memory_limit"1Gi"MediumThe default is adequate for standard flows. Flows that process large payloads, use the node-red-contrib-image-tools node, or install heavy npm dependencies can require 2Gi or more.
cpu_limit"1000m"LowNode-RED is primarily I/O-bound. However, CPU-intensive function nodes or heavy message transformation can cause throttling at values below 500m.
database_type"NONE"HighNode-RED does not require a database. Setting this to POSTGRES or MYSQL enables the Cloud SQL Auth Proxy sidecar unnecessarily, increasing startup time and cost. Leave as "NONE".
enable_cloudsql_volumefalseMediumNode-RED has no database. Setting enable_cloudsql_volume = true with database_type = "NONE" causes the Cloud SQL Auth Proxy sidecar to fail to start, blocking the main container.
secret_environment_variables{}MediumDo not manually set NODE_RED_CREDENTIAL_SECRET via secret_environment_variables. It is auto-managed by the Foundation Module via database_password_length. Overriding it breaks the credential encryption key management.
environment_variables{}MediumDo not set NODE_RED_ENABLE_SAFE_MODE = "true" in production — safe mode disables all flows, preventing any automation from running. It is injected as "false" by default.
ingress_settings"all"MediumSetting to "internal" blocks all incoming webhook messages from external services. Use "internal-and-cloud-load-balancing" with Cloud Armor for production deployments receiving public webhooks.
vpc_egress_setting"PRIVATE_RANGES_ONLY"MediumSetting to "all-traffic" routes outbound Node-RED HTTP calls through the VPC connector. If VPC firewall rules restrict external egress, all http request nodes calling public APIs will fail.
enable_iapfalseHighEnabling IAP without valid iap_authorized_users or iap_authorized_groups causes all requests to return 403, blocking access to the Node-RED editor.
enable_cloud_armorfalseMediumThe Node-RED editor UI is publicly accessible by default. Enable Cloud Armor with admin_ip_ranges to restrict editor access in production.
enable_redisfalseLowNode-RED does not use Redis natively. Enabling Redis provisions the connection strings but they are not used by Node-RED core. Only enable if custom nodes explicitly require Redis.
secret_rotation_period"2592000s" (30 days)LowThis governs the SMTP password rotation period. Very short rotation periods can cause Node-RED SMTP nodes to use stale credentials during the propagation window.

Destroying Resources

Known Deletion Issue: Serverless IPv4 Address Release

When destroying a Cloud Run deployment, you may encounter an error similar to:

Error: Error waiting for Subnetwork to be deleted: The following serverless IPv4 address(es) on subnet ... are still in use.

Cause: GCP holds serverless IPv4 addresses on the VPC subnet asynchronously after a Cloud Run service is deleted. These addresses are released by GCP approximately 20–30 minutes after the Cloud Run service is removed. Terraform/OpenTofu cannot complete the subnet or VPC deletion until they are fully released.

Resolution: Wait 20–30 minutes after the initial destroy attempt, then re-run the destroy command:

tofu destroy

The second run will succeed once GCP has released the reserved addresses.