|:------------------------------------------------------:|
| β‘οΈ B o x L a n g β‘οΈ
| Dynamic : Modular : Productive
|:------------------------------------------------------:|
Copyright Since 2023 by Ortus Solutions, Corp
www.boxlang.io | www.ortussolutions.com
Β
π Production-ready template for building and deploying BoxLang applications to AWS Lambda. This template provides a complete Java-BoxLang hybrid runtime with Gradle build automation, comprehensive testing, and AWS SAM deployment scripts.
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β AWS Lambda β β LambdaRunner β β BoxLang App β
β Runtime βββββΆβ (Java Wrapper) βββββΆβ (Lambda.bx) β
β (Java 21) β β β β β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
Handler Invocation Event Processing Business Logic
Context Management Response Formatting Application Lifecycle
Key Components:
- π¦ BoxLang AWS Lambda Runtime: Maven dependency
io.boxlang:boxlang-aws-lambda:1.4.0 - π― Lambda Handler:
ortus.boxlang.runtime.aws.LambdaRunner::handleRequest - π BoxLang Code: Lives in
src/main/bx/(Lambda.bx, Application.bx) - βοΈ Java Wrapper: Gradle build system with shadow JAR packaging
- ποΈ Deployment: ZIP artifact for AWS Lambda with SAM template
The main lambda code is located in src/main/bx/Lambda.bx and the test code is located in src/test/java/com/myproject.
- β Java 21+ (required for runtime)
- π§ AWS CLI (for deployment)
- ποΈ SAM CLI (for local testing)
-
π§ͺ Run tests to verify setup:
./gradlew test -
π¦ Build deployment package:
./gradlew build
Your deployable ZIP will be created at build/distributions/boxlang-aws-project-<version>.zip
Copy the config template and customize for your environment:
cp workbench/config.env workbench/config.local.env
# Edit config.local.env with your settingsKey settings:
# BoxLang Lambda Deployment Configuration
# Copy this file to config.local.env and customize for your environment
# S3 Bucket for Lambda artifacts (required)
# Must be globally unique, 3-63 characters, lowercase letters/numbers/hyphens only
AWS_LAMBDA_BUCKET=my-boxlang-lambda-artifacts
# AWS Region (optional - uses your default AWS region if not set)
AWS_REGION=us-east-1
# CloudFormation Stack Name (optional - defaults to 'boxlang-lambda-stack')
STACK_NAME=my-boxlang-lambda
# Lambda Function Name for direct invocation (optional)
# Use this to invoke by function name instead of looking up via stack
FUNCTION_NAME=my-boxlang-lambda
# Lambda Function Configuration (optional)
LAMBDA_MEMORY=128
LAMBDA_TIMEOUT=15
# Deployment Environment (optional)
ENVIRONMENT=dev
./workbench/1-create-bucket.sh./workbench/2-deploy.shThis will:
- Build your BoxLang project
- Upload to S3
- Deploy via CloudFormation with your configured parameters
- Show function name and settings
./workbench/3-invoke.shπ‘ Pro Tip: The deployment scripts automatically use your configuration from
config.local.envβconfig.envβ environment variables and the workbench/sampleEvents/event-live.json
This template includes complete GitHub Actions workflows for automated testing, building, and deployment. All workflows are production-ready and can be used immediately.
Purpose: Reusable testing workflow with comprehensive validation
Features:
- β Java 21 setup with caching
- π Full test suite execution via Gradle
- π Test reports as workflow artifacts
- π Reusable across multiple workflows
Usage: Automatically called by other workflows or can be triggered manually
Purpose: Complete build, test, and optional AWS deployment pipeline
Features:
- ποΈ Full build with shadow JAR and Lambda ZIP creation
- π§ͺ Test execution via reusable test workflow
- π¦ Build artifacts uploaded (ZIP, JAR, test reports)
- π§ AWS Lambda deployment (commented out, ready to enable)
- π€ S3 distribution upload (commented out, ready to enable)
- π·οΈ GitHub release creation (commented out, ready to enable)
Triggers:
- Push to
mainbranch - Manual workflow dispatch
π‘ AWS Deployment: Ready-to-use Lambda function updates:
# Uncomment these lines in .github/workflows/release.yml for AWS deployment:
- name: Update AWS Lambda Function
uses: kazimanzurrashid/aws-lambda-update-action@v2.0.3
with:
zip-file: "./build/distributions/${{ env.PROJECT_NAME }}-${{ env.VERSION }}.zip"
lambda-name: ${{ env.PROJECT_NAME }}-${{ env.DEPLOY_TIER }}
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_PUBLISHER_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_PUBLISHER_KEY }}
β οΈ Important: You must create the Lambda function FIRST (using the workbench scripts), then uncomment the AWS deployment workflow to enable automatic function updates on releases.
Purpose: Development builds and testing for non-release branches
Features:
- π§ Development builds with snapshot versioning
- π§ͺ Test execution for validation
- π¦ Snapshot artifacts for testing
- πΏ Branch-based development workflow
Triggers:
- Push to any branch except
main - Pull requests
Add these secrets to your GitHub repository (Settings β Secrets and variables β Actions):
AWS_REGION # e.g., us-east-1
AWS_PUBLISHER_KEY_ID # AWS Access Key ID
AWS_SECRET_PUBLISHER_KEY # AWS Secret Access Key-
Deploy function first using workbench scripts:
./workbench/1-create-bucket.sh ./workbench/2-deploy.sh
-
Uncomment AWS deployment in
.github/workflows/release.yml -
Push to main or trigger workflow manually
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Push to main β β Release Flow β β AWS Lambda β
β (or manual) βββββΆβ β’ Build βββββΆβ β’ Update β
β β β β’ Test β β β’ Deploy β
βββββββββββββββββββ β β’ Package β βββββββββββββββββββ
βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β Artifacts β
β β’ Lambda ZIP β
β β’ Shadow JAR β
β β’ Test Reportsβ
βββββββββββββββββββ
π― Pro Tip: The workflows are designed for zero-configuration operation. Just create your GitHub repository, add AWS secrets if needed, and push code. The CI/CD pipeline handles the rest!
Here is a comprehensive overview of the project structure:
| File/Folder | Required | In Git | Description |
|---|---|---|---|
π build/ |
β | β | Temporary build assets (generated by Gradle) |
π gradle/ |
β | β | Gradle wrapper and configuration |
π src/ |
β | β | Your module source code |
π workbench/ |
β | β | AWS deployment scripts and SAM template |
π .cfformat.json |
β | β | CFFormat configuration (Ortus Standards) |
π .editorconfig |
β | β | Editor consistency settings |
π .gitattributes |
β | β | Git attributes |
π .gitignore |
β | β | Git ignore patterns |
π .markdownlint.json |
β | β | Markdown linting rules |
π .ortus-java-style.xml |
β | β | Java style guide (IntelliJ/VSCode/Eclipse) |
π box.json |
β | β | BoxLang dependencies and automations |
π build.gradle |
β | β | Gradle build configuration |
π changelog.md |
β | β | Version history tracking |
π gradlew |
β | β | Gradle wrapper (Linux/macOS) |
π gradlew.bat |
β | β | Gradle wrapper (Windows) |
π settings.gradle |
β | β | Gradle project settings |
π Legend: β = Required/Included, β = Optional/Excluded
- π§βπ»
main/- Production source codebx/- BoxLang source filesApplication.bx- Application lifecycle hooks and configurationLambda.bx- Your Lambda entry point (implementsrun(event, context, response))- (Add your BoxLang classes here)
- π§ͺ
test/- Test source codejava/com/myproject/- JUnit test classesLambdaIntegrationTest.java- Comprehensive Lambda integration testsmocks/TestContext.java- Mock AWS Lambda Contextmocks/TestLogger.java- Test logging utilitiesrunner/LocalLambdaRunner.java- Local Lambda test runner
- ποΈ
resources/- Runtime resources- βοΈ
boxlang.json- BoxLang runtime configuration - π¦
boxlang_modules/- Local BoxLang modules (auto-packaged) - π§
libs/- Any non-maven managed Jars that you want to include in your project
- βοΈ
The workbench provides a complete AWS deployment and testing workflow:
- π οΈ
0-check-aws.sh- AWS credentials troubleshooter (diagnoses configuration issues) - πͺ£
1-create-bucket.sh- Creates S3 bucket for deployment artifacts - π
2-deploy.sh- Builds and deploys Lambda via SAM/CloudFormation - π
3-invoke.sh- Invokes deployed Lambda with test payloads - π§Ή
4-cleanup.sh- Cleanup deployment resources and stack
- π
config.env- Default configuration template (copy toconfig.local.env) - π
config.local.env- Your local settings (gitignored)
- π
template.yml- SAM template for AWS deployment (parameterized) - π§ͺ
template-local.yml- SAM template for local development with HTTP endpoints - π
event-live.json- Production test payload for Lambda invocation - π
sampleEvents/- Sample events (API Gateway, S3, etc.)
Your main Lambda logic goes in src/main/bx/Lambda.bx. The entry point must be named run:
/**
* Lambda Entry Point
* Convention: run(event, context, response)
*/
class {
function run( event, context, response ) {
response.body = {
"error": false,
"messages": [],
"data": "Hello from BoxLang Lambda! Event: " & event.toString()
}
response.statusCode = 200
}
// Alternative function (call with x-bx-function header)
function anotherFunction( event, context, response ) {
return "Alternative lambda function!"
}
}event: AWS Lambda event object (API Gateway, S3, etc.)context: AWS Lambda context (com.amazonaws.services.lambda.runtime.Context)response: Response object with standard structure:statusCode- HTTP status (default: 200)headers- HTTP headers map/structbody- Response payload (your data goes here)cookies- Array of response cookies
Use src/main/bx/Application.bx for initialization and request processing:
class {
this.name = "My-AWS-Lambda"
function onApplicationStart() {
// Initialize databases, caches, etc.
return true;
}
function onRequestStart( targetPage ) {
// Per-request initialization
return true;
}
}Project Name: Defined in settings.gradle
rootProject.name = 'boxlang-aws-project'Versions: Configured in gradle.properties and build.gradle
# gradle.properties
version=1.0.0
jdkVersion=21
boxlangVersion=1.0.0Configure BoxLang behavior in src/resources/boxlang.json:
Key Settings for AWS Lambda:
- π
trustedCache: true- Enables class caching (recommended for production) - π
requestTimeout- Should match your Lambda timeout - π
timezone- Use${env:TZ:UTC}to respect Lambda environment - π
logging.*.appender: "console"- Required for CloudWatch logs
Method 1: CommandBox CLI
You can leverage the CommandBox CLI to install BoxLang modules easily.
# Install to src/resources/boxlang_modules/
box install {moduleName} --production --directory=src/resources/boxlang_modulesMethod 2: Via box.json
CommandBox will read your box.json file for module dependencies. This is a durable way to manage your dependencies.
{
"dependencies": {
"bx-pdf": "^1.0.0",
"bx-mysql": "^1.0.0"
},
"installPaths": {
"bx-pdf": "src/resources/boxlang_modules/bx-pdf",
"bx-mysql": "src/resources/boxlang_modules/bx-mysql"
}
}Then run:
box install --productionRemember that these dependencies should not be added to your source control (e.g., Git).
Method 3: BoxLang Module Installer
The BoxLang module installer is an OS level CLI tool that is used to install modules easily without CommandBox. Eventually, this tool and CommandBox will merge, but it is here for reference.
cd src/resources
install-bx-module <module-name> --localModules are automatically packaged into your deployment ZIP:
build/distributions/your-lambda.zip
βββ Lambda.bx
βββ boxlang.json
βββ lib/
β βββ (jars)
βββ boxlang_modules/ # β Your modules go here
βββ bx-pdf/
βββ bx-mysql/
Development Workflow:
# 1. Run tests
./gradlew test
# 2. Build deployment package
./gradlew build
# 3. Deploy to AWS
./workbench/2-deploy.sh| Task | Description | Output |
|---|---|---|
ποΈ build |
Full build lifecycle (clean, compile, test, package) | build/distributions/*.zip |
π§Ή clean |
Delete build artifacts and temporary files | - |
β compileJava |
Compile Java source files | build/classes/java/main/ |
π§ͺ compileTestJava |
Compile Java test files | build/classes/java/test/ |
π dependencyUpdates |
Check for newer dependency versions | Console report |
π shadowJar |
Create uber-JAR with all dependencies | build/distributions/ |
π buildLambdaZip |
Package Lambda deployment ZIP | build/distributions/*.zip |
π jar |
Create standard JAR (without dependencies) | build/libs/ |
π javadoc |
Generate Java API documentation | build/docs/javadoc/ |
π§ͺ test |
Run JUnit tests | build/reports/tests/ |
π runLocal |
Run Lambda locally with default event | Console output |
π runLocalApi |
Run Lambda locally with API Gateway event | Console output |
π§ runLocalLegacy |
Run Lambda locally with legacy API event | Console output |
π startSamServer |
Start SAM local API server (foreground) | HTTP server at :3000 |
π startSamServerBackground |
Start SAM local API server (background) | HTTP server at :3000 |
π stopSamServer |
Stop background SAM server | - |
β¨ spotlessApply |
Auto-format source code | - |
π spotlessCheck |
Check code formatting | - |
π tasks |
List all available Gradle tasks | - |
build/distributions/
βββ boxlang-aws-project-1.0.0.zip # π Deploy this to AWS Lambda
βββ boxlang-aws-project-1.0.0-all.jar # π¦ Shadow JAR (uber-JAR)
βββ boxlang-aws-project-1.0.0/ # π Unpacked contents
βββ Lambda.bx # Your BoxLang entry point
βββ boxlang.json # Runtime configuration
βββ lib/ # All Java dependencies
βββ boxlang_modules/ # BoxLang modules
src/test/java/com/myproject/
βββ LambdaIntegrationTest.java # Comprehensive integration tests
βββ mocks/
β βββ TestContext.java # Mock AWS Lambda Context
β βββ TestLogger.java # Test logging utilities
βββ runner/
βββ LocalLambdaRunner.java # Local Lambda test runner
# Run all tests
./gradlew test
# Run specific test class
./gradlew test --tests "com.myproject.LambdaIntegrationTest"
# Run with detailed output
./gradlew test --infoAfter running tests, view results at:
- π HTML Report:
build/reports/tests/test/index.html - π XML Results:
build/test-results/test/
@Test
@DisplayName("Test Lambda.bx execution")
public void testValidLambda() throws IOException {
Path validPath = Path.of("src", "main", "bx", "Lambda.bx");
LambdaRunner runner = new LambdaRunner(validPath, true);
Context context = new TestContext();
var event = new HashMap<String, Object>();
event.put("name", "Ortus Solutions");
event.put("when", Instant.now().toString());
IStruct response = runner.handleRequest(event, context);
assertThat(response.getAsInteger(Key.of("statusCode"))).isEqualTo(200);
}Test your Lambda locally without deploying to AWS:
# Test locally with default event
./gradlew runLocal
# Test with API Gateway event
./gradlew runLocalApi
# Test with custom event file
./gradlew runLocal -PeventFile=workbench/sampleEvents/s3-event.jsonIf you have SAM CLI installed:
# Start local API server (HTTP endpoint testing)
./workbench/5-test-local.shThis creates a local HTTP endpoint at http://localhost:3000 where you can:
- Send HTTP requests directly to your Lambda
- Test API Gateway integration locally
- Debug with hot reload capabilities
workbench/sampleEvents/
βββ api.json # API Gateway HTTP v2.0 event
βββ api-post.json # POST request with JSON body
βββ event.json # Legacy API Gateway event
βββ event-live.json # Production test payload (used by 3-invoke.sh)
βββ event-local.json # Local development test payload
βββ s3-event.json # S3 bucket notification event
The built-in LocalLambdaRunner provides:
- β‘ Fast execution - No deployment required
- π Performance metrics - Shows execution time
- π JSON output formatting - Pretty-printed responses
- π Multiple event support - Easy event switching
- β Error handling - Clear error messages with stack traces
The LambdaIntegrationTest suite includes:
- Basic Lambda execution - Validates core functionality
- API Gateway simulation - Tests HTTP request/response handling
- Complex nested data - Handles rich JSON payloads
- Performance testing - Large payload stress testing (5-second timeout)
- Error handling - Null value and edge case testing
- Mock AWS Context - Realistic Lambda environment simulation
Test scenarios covered:
@Test void testBasicExecution() // Core Lambda functionality
@Test void testApiGatewayEvent() // HTTP API simulation
@Test void testComplexEvent() // Nested JSON structures
@Test void testLargePayload() // Performance validation
@Test void testNullHandling() // Edge case testingFor HTTP endpoint testing, start a local API Gateway simulation:
Background Server (Recommended for Development):
# Start server in background
./gradlew startSamServerBackground
# Your Lambda is now available at http://localhost:3000
curl http://localhost:3000
curl -X POST http://localhost:3000 -d '{"test":"data"}' -H 'Content-Type: application/json'
# Stop when done
./gradlew stopSamServerForeground Server:
# Start server in foreground (blocks terminal)
./gradlew startSamServer
# Press Ctrl+C to stopTest Endpoints:
# Manual testing examples with curl
curl http://localhost:3000
curl -X POST http://localhost:3000/api/users \
-H 'Content-Type: application/json' \
-d '{"name":"John","email":"john@example.com"}'
# Or use your favorite HTTP client:
# - Postman
# - Insomnia
# - HTTPie: http POST localhost:3000/api/users name=John email=john@example.comDevelopment Workflow:
- π
./gradlew startSamServerBackground- Start server - βοΈ Edit
src/main/bx/Lambda.bx- Make changes - π
./gradlew build- Rebuild (server auto-reloads) - π§ͺ
curl http://localhost:3000- Test changes - π Repeat steps 2-4 for rapid development
Requirements:
- SAM CLI installed:
brew install aws-sam-cli - AWS credentials configured (can use dummy values for local testing)
The workbench/ directory provides complete deployment automation:
| Script | Purpose | Requirements |
|---|---|---|
πͺ£ 1-create-bucket.sh |
Create S3 bucket for artifacts, skip if defined already | AWS CLI configured |
π 2-deploy.sh |
Build & Deploy via CloudFormation | S3 bucket must exist & AWS CLI Configured |
π 3-invoke.sh |
Test deployed Lambda | Lambda deployed |
π§Ή 4-cleanup.sh |
Remove AWS resources | - |
The deployment uses workbench/template.yml with configurable parameters:
Parameters:
LambdaMemorySize:
Type: Number
Default: 128
Description: Memory allocated to the Lambda function (MB)
LambdaTimeout:
Type: Number
Default: 15
Description: Lambda function timeout (seconds)
Environment:
Type: String
Default: "dev"
Description: Deployment environment (dev, staging, prod)
Resources:
bxFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: build/distributions/boxlang-aws-project-1.0.0.zip
Handler: ortus.boxlang.runtime.aws.LambdaRunner::handleRequest
Runtime: java21
Timeout: !Ref LambdaTimeout
MemorySize: !Ref LambdaMemorySize
Environment:
Variables:
ENVIRONMENT: !Ref Environment
BOXLANG_DEBUG: "false"
Outputs:
FunctionName:
Description: "BoxLang Lambda Function Name"
Value: !Ref bxFunctionπ‘ Configuration: The deploy script passes your
config.local.envvalues as CloudFormation parameters
# Test with production payload (uses event-live.json)
./workbench/3-invoke.shThe 3-invoke.sh script:
- Loads your configuration from
config.local.env - Uses the
FUNCTION_NAMEsetting (or derives it fromSTACK_NAME) - Invokes with
event-live.jsonas test payload - Shows the response and execution details
# Test with custom payload
aws lambda invoke --function-name your-function \
--payload '{"name":"test","data":"hello"}' \
response.json && cat response.json
# List your functions
aws lambda list-functions --query 'Functions[?contains(FunctionName, `boxlang`)].FunctionName'Your config.local.env settings are used throughout the deployment:
# Example config.local.env
STACK_NAME=my-api-stack
AWS_LAMBDA_BUCKET=my-unique-bucket-name
LAMBDA_MEMORY=512 # Higher memory for performance
LAMBDA_TIMEOUT=30 # Longer timeout for complex operations
FUNCTION_NAME=my-api-stack-bxFunction-ABC123DEF456
ENVIRONMENT=productionWhen you deploy, you'll see:
βοΈ Lambda Memory: 512MB, Timeout: 30s, Environment: production
The template uses a hierarchical configuration system: config.local.env β config.env β environment variables
| Variable | Description | Example | Used By |
|---|---|---|---|
AWS_LAMBDA_BUCKET |
S3 bucket for artifacts (globally unique) | my-company-lambda-artifacts |
All deployment scripts |
| Variable | Default | Description | Used By |
|---|---|---|---|
STACK_NAME |
boxlang-lambda-stack |
CloudFormation stack name | 2-deploy.sh, 4-cleanup.sh |
FUNCTION_NAME |
{STACK_NAME}-bxFunction-{SUFFIX} |
Direct function name for invocation | 3-invoke.sh |
| Variable | Default | Description | Constraints |
|---|---|---|---|
LAMBDA_MEMORY |
128 |
Memory allocation (MB) | 128-10240 MB |
LAMBDA_TIMEOUT |
15 |
Timeout in seconds | 1-900 seconds |
ENVIRONMENT |
dev |
Deployment environment tag | dev/staging/prod |
| Variable | Default | Description | Used By |
|---|---|---|---|
AWS_REGION |
your default | AWS region for deployment | All AWS CLI operations |
cp workbench/config.env workbench/config.local.env# config.local.env (this file is gitignored)
AWS_LAMBDA_BUCKET=my-unique-bucket-2024
STACK_NAME=my-api-prod
LAMBDA_MEMORY=256
LAMBDA_TIMEOUT=30
ENVIRONMENT=production# Check if AWS is configured
./workbench/0-check-aws.sh
# Deploy with your config
./workbench/2-deploy.sh- β
Use
config.local.env- Keep your settings out of git - β Unique bucket names - Include company/project prefix
- β
Environment-specific stacks -
my-app-dev,my-app-prod - β Resource sizing - Start small, scale up based on needs
- β
Timeout alignment - Match Lambda timeout with
boxlang.jsonsettings
# Clone or download the template
git clone <your-repo>
cd boxlang-aws-lambda-template
# Configure your deployment settings
cp workbench/config.env workbench/config.local.env
# Edit config.local.env with your AWS settings# Test locally during development
./gradlew runLocal # Quick local test
./gradlew test # Run full test suite
# Test with HTTP endpoints (if SAM CLI installed)
./gradlew startSamServerBackground # Start local API server
curl http://localhost:3000 # Test your endpoints
./gradlew stopSamServer # Stop when done# Verify AWS configuration
./workbench/0-check-aws.sh
# Full build and test
./gradlew clean build test
# Verify your config
cat workbench/config.local.env# Create S3 bucket (one-time setup)
./workbench/1-create-bucket.sh
# Deploy to AWS Lambda
./workbench/2-deploy.sh
# Test deployed function
./workbench/3-invoke.sh# Make code changes in src/main/bx/Lambda.bx
# Run tests
./gradlew test
# Redeploy
./gradlew build && ./workbench/2-deploy.sh
# Test updated function
./workbench/3-invoke.sh# Remove all AWS resources
./workbench/4-cleanup.sh./gradlew runLocal # Test locally
./gradlew test # Run tests
./gradlew build # Build package./workbench/0-check-aws.sh # Check AWS setup
./workbench/1-create-bucket.sh # Create S3 bucket
./workbench/2-deploy.sh # Deploy to AWS
./workbench/3-invoke.sh # Test deployed function
./workbench/4-cleanup.sh # Remove AWS resources./gradlew runLocal # Default event
./gradlew runLocalApi # API Gateway event
./gradlew runLocalLegacy # Legacy API event
./gradlew startSamServerBackground # HTTP server
./gradlew stopSamServer # Stop server- π§ͺ Test locally before deploying - Use
./gradlew testto catch issues early - π Use the wrapper - Always use
./gradlew(notgradle) for consistency - π¦ Check your ZIP - Verify
build/distributions/*.zipcontains expected files - π§ Configure for production - Set
trustedCache: trueinboxlang.json
Spacing around symbols: Always add spaces around parentheses ( ), brackets [ ], braces { }, and operators for readability
Examples:
- β
function run( event, context, response ) - β
function run(event,context,response) - β
var results = [ 1, 2, 3 ] - β
var results = [1,2,3] - β
if ( condition ) { doSomething(); } - β
if(condition){doSomething();}
Apply this spacing standard to all BoxLang, Java, and configuration code in the project.
| Problem | Solution |
|---|---|
| β Tests fail with ClassNotFoundException | Check dependency resolution, run ./gradlew clean build |
| β Gradle build fails | Ensure Java 21+ installed, run ./gradlew --version |
| β BoxLang class not found | Check module paths in src/resources/boxlang_modules/ |
| β Large deployment package | Review dependencies in build.gradle, exclude unnecessary JARs |
| Problem | Solution |
|---|---|
| β AWS credentials not configured | Run ./workbench/0-check-aws.sh for diagnosis |
| β S3 bucket already exists | Choose a globally unique bucket name in config.local.env |
| β CloudFormation deployment fails | Check AWS permissions, review stack events in AWS Console |
| β Lambda function not found | Verify FUNCTION_NAME in config matches deployed function |
| Problem | Solution |
|---|---|
| β Lambda timeout in AWS | Increase LAMBDA_TIMEOUT in config and redeploy |
| β Lambda memory errors | Increase LAMBDA_MEMORY in config and redeploy |
| β BoxLang initialization errors | Check boxlang.json configuration, enable debugMode: true |
| β Module loading failures | Verify modules in src/resources/boxlang_modules/ directory |
# Check AWS configuration
./workbench/0-check-aws.sh
# Verify project build
./gradlew clean build test
# Test locally before deployment
./gradlew runLocal
# Check deployed function
aws lambda list-functions --query 'Functions[?contains(FunctionName, `boxlang`)].FunctionName'π Additional Help: See
workbench/DEPLOYMENT.mdfor detailed deployment troubleshooting
BoxLang is a professional open-source project and it is completely funded by the community and Ortus Solutions, Corp. Ortus Patreons get many benefits like a cfcasts account, a FORGEBOX Pro account and so much more. If you are interested in becoming a sponsor, please visit our patronage page: https://patreon.com/ortussolutions
"I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12
{ "debugMode": false, // Enable for development "trustedCache": true, // Enable for production "requestTimeout": "0,0,15,0", // 15 minute timeout (matches AWS Lambda) "timezone": "${env:TZ:UTC}", // Use TZ environment variable or UTC "logging": { "rootLevel": "WARN", // ERROR, WARN, INFO, DEBUG, TRACE "loggers": { "runtime": { "level": "INFO", "appender": "console" } } } }