Skip to content

Configuration

Lumo uses minimal configuration to get you up and running quickly. The framework automatically discovers your functions and applies sensible defaults, while still allowing customisation when needed.

Configuration Files

lumo.config.js

The main configuration file for your Lumo project.

javascript
// lumo.config.js
export default {
  projectName: 'example',
  environment: 'dev',
  provider: 'aws',
  region: 'us-east-1',
}

Configuration Options

Required Options

OptionTypeDescription
projectNamestringName of your project
providerenumDeployment provider: 'aws' or 'cloudflare'

Optional Options

OptionTypeDefaultDescription
environmentstring'dev'Environment name (dev, staging, production, etc.)
regionstring-AWS region (required for AWS provider) AWS
domainNamestring-Custom domain for your API
networkingobject-AWS VPC networking configuration AWS
networking.natGatewaysnumber0Number of NAT gateways (0-3) AWS
buildobject-Build configuration options
build.excludestring[][]Files/patterns to exclude from build
secretsobject-Secret management configuration
eventsobject-Event system configuration
events.eventBusstring'default'Event bus name AWS
events.subscribersobject-Event subscriber mappings

Default External Modules

The following modules are automatically excluded from builds and don't need to be specified in build.exclude:

AWS Provider AWS:

  • Node.js built-ins: node:*
  • AWS SDK: @aws-sdk/*, aws-sdk, aws-cdk-lib, constructs, @aws-cdk/*
  • Database drivers: mysql2, mysql, sqlite3, oracledb, pg-native, tedious, better-sqlite3
  • Build tools: esbuild, typescript, webpack, rollup, vite

Cloudflare Provider Cloudflare:

  • Cloudflare Workers built-ins: cloudflare:*
  • Node.js built-ins: Automatically aliased to browser-compatible implementations

Secrets Management

Define secrets with optional descriptions:

javascript
secrets: {
  databaseUrl: {
    value: process.env.DATABASE_URL,
    description: 'PostgreSQL database connection string'
  },
  apiKey: {
    value: () => process.env.API_KEY || generateRandomKey(),
    description: 'Third-party API authentication key'
  }
}

Events

Wire up events to subscribers for an event-driven architecture. This allows different parts of your application to react to events without tight coupling.

javascript
events: {
  eventBus: 'production', // Event bus name (defaults to 'default', AWS only)
  subscribers: {
    'user-service': {
      events: ['user.created', 'user.updated', 'user.deleted']
    },
    'notification-service': {
      events: ['user.created', 'order.completed']
    }
  }
}