Skip to main content
Command-line tool — Add compute and storage resources to existing applications.

Overview

The fjall add command extends your existing applications with new compute or storage resources. It intelligently handles connections between resources and updates your infrastructure code.

Usage

fjall add [resource] [options]

Resource Types

Storage Resources

Add databases to your application:
# With resource type
fjall add storage:aurora --app app
fjall add storage:instance --app app
fjall add storage:freetier --app app

Compute Resources

Add compute services:
# With resource type
fjall add compute:lambda --app app
fjall add compute:ecs --app app
fjall add compute:ec2 --app app

Examples

Add Aurora Database

fjall add storage:aurora --app app
Or with custom name:
fjall add storage:aurora --app app --name Analytics

Add Lambda Function

fjall add compute:lambda --app app
Or with custom name and type:
fjall add compute:lambda --app app --name OrderProcessor --type basic

Add ECS Service with Options

fjall add compute:ecs --app app --subtype spot
This creates an ECS service using Spot instances for cost savings.

Options

OptionDescriptionExample
--app <name>Target application--app app
--type <type>Lambda function type--type basic
--name <name>Custom resource name--name OrderProcessor
--subtype <type>Resource subtype--subtype spot
-v, --verboseShow detailed logsfjall add -v

Resource Subtypes

ECS Subtypes

  • fargate - Serverless containers (default)
  • spot - Cost-optimised Spot instances
  • freetier - t2.micro instances

Storage Types

  • aurora - Serverless Aurora for production
  • instance - Traditional RDS instances
  • freetier - Free tier RDS database

Connection Management

Automatic Connections

When adding resources, Fjall automatically:
  1. Detects existing resources
  2. Prompts for connections
  3. Configures security groups
  4. Sets environment variables

Environment Variables

Connected resources receive automatic environment variables:
# First database connection
DATABASE_HOST=app-db.cluster-xxx.amazonaws.com
DATABASE_PORT=5432
DATABASE_NAME=AppDatabase
DATABASE_PASSWORD=<from-secrets-manager>

# Additional database connections
DATABASE_HOST_1=analytics-db.cluster-xxx.amazonaws.com
DATABASE_PORT_1=5432
DATABASE_NAME_1=AnalyticsDB
DATABASE_PASSWORD_1=<from-secrets-manager>

Advanced Examples

Add Multiple Resources

Chain commands for complex setups:
# Add analytics database
fjall add storage:aurora --app app --name Analytics

# Add worker compute
fjall add compute:lambda --app app --name Worker

# Add API service
fjall add compute:ecs --app app --name API --subtype fargate

Cost-Optimised Setup

Use free tier and spot instances:
# Free tier database
fjall add storage:freetier --app app

# Spot instance compute
fjall add compute:ecs --app app --subtype spot

Resource Naming

Fjall uses intelligent naming:
  1. Default naming: appName + ResourceType
    • App: app
    • Storage: appStorage, appStorage1, appStorage2
  2. Custom naming: Use --name flag
    • fjall add storage:aurora --name Analytics
    • Creates: appAnalytics

Best Practices

  1. Plan connections: Think about which resources need to communicate
  2. Use descriptive names: Help identify resources later
  3. Consider costs: Use spot/freetier subtypes for development
  4. Security: Only connect resources that need access

Post-Add Steps

After adding resources:
  1. Review changes: Check the modified infrastructure.ts
  2. Deploy: Run fjall deploy [app-name]
  3. Verify: Use fjall view to check resource status

Troubleshooting

Connection Issues

If resources can’t connect:
# Check security groups
fjall view config --app app

# Verify environment variables
fjall deploy app --verbose

Naming Conflicts

If a resource name exists:
  • Fjall auto-increments: storage, storage1, storage2
  • Or use custom name: --name UniqueStorage
Always run fjall deploy after adding resources to apply changes to AWS.