Introduction
Fjall simplifies AWS infrastructure deployment through factory patterns - high-level abstractions that handle the complexity of creating, configuring, and connecting cloud resources. Instead of managing hundreds of configuration options, factories provide sensible defaults while allowing customization when needed.The Three Core Factories
Fjall’s infrastructure-as-code approach centers around three main abstractions:1. Compute Factory
The ComputeFactory deploys application workloads across three compute models:- ECS - Container-based deployment with Fargate (serverless), Free Tier (t3.micro), or Spot instances (70% cost savings)
- EC2 - Traditional virtual machines with auto-scaling groups
- Lambda - Serverless functions with optional EventBridge scheduling
2. Database Factory
The DatabaseFactory provisions managed databases:- Aurora - Serverless Aurora v2 with auto-scaling capacity and built-in RDS Proxy
- Instance - Traditional RDS instances with configurable size and Multi-AZ support
- FreeTier - Cost-free development databases (t3.micro, single-AZ)
3. Network Configuration
Network configuration is passed during App initialization and controls VPC setup:- Maximum availability zones
- NAT gateway configuration (cost optimization)
- VPC flow logs
- Interface and gateway VPC endpoints
How Factories Work
All factories follow a consistent pattern:Key Benefits
Type-Based Routing
A single factory method creates different resources based on thetype parameter - no need to learn separate constructors for each AWS service.
Automatic Integration
Factories understand each other. Pass a database to theconnections array and security groups are configured automatically. Use helper methods like getCredentials() for type-safe secret imports.
Sensible Defaults
Every factory ships with production-ready defaults: encryption at rest, Container Insights, ECS Exec, proper IAM roles, and CloudWatch logging.Cost Optimization Built-In
Free Tier and Spot compute options, optional NAT gateways, and right-sized instances make it easy to optimize costs without sacrificing functionality.App Context
Access defaults from the App context:getDefaultVpc(), getDefaultContainerRegistry(), and more. No need to manually wire every resource.