SlideShare a Scribd company logo
Dynamic AWS
Lambda with
LED BY
Luis F. Majano
LUIS F. MAJANO
‱ CEO Ortus Solutions
‱ Computer Engineer
‱ Born in El Salvador => Raised in the USA
‱ 2023 Leading EU Expansion team (Malaga, Spain đŸ‡Ș🇾)
‱ Creator & Maintainer:
ColdBox MVC, TestBox BDD/TDD, CommandBox CLI, ContentBox CMS, etc.
‱ Creator / Chief Language Engineer BoxLang Programming Language
@lmajano @ortussolutions
‱ Serverless
‱ What? Why? When?
‱ Providers
‱ Use Cases
‱ Real Life Case
‱ Best Practices
Agenda
‱ BoxLang
‱ Lambda Runtime
‱ Lambda Template
Part 1 Part 2
AWS Lambda - Serverless Computing
FaaS
AWS Lambda is a serverless computing service that runs
code in response to events without managing servers,
automatically scaling and charging only for execution time.
What is serverless?
Serverless Computing Evolution
Physical Machines
Virtual Machines
Containers
Lambdas
Focus on Business Logic
Abstraction
Execution Patterns
‱ API Driven Patterns
‱ Event Driven Patterns
‱ Data Streaming Patterns
‱ Scheduling Patterns
Key Points about Serverless
‱ Me
‱ Focus on code abstractions
‱ Provider
‱ Auto Scaling
‱ Fault tolerance
‱ High Availability
‱ Metrics and Logging
‱ No OS updates
‱ Pay per use ONLY
Fine-Grained Pricing: Never pay for idle
‱ FREE Tier
‱ Buy in 100ms increments
‱ No minimums
‱ No per-device fees
‱ No idle fees
How Functions Work
Upload Function
(CI, Manually)
De
fi
ne Function Triggers
(API Calls, Events, Schedules)
Function Execution
(Stateless, Cold Start,
Timeouts)
Different Providers
Different Language Implementations
PHP
Node.js
Python
Go
Ruby
.Net
Core Concept of Serverless is 
.
Function = Unit of Work
Common Use Cases
REST Data Processing
Chat Bots
Amazon Alexa IoT
Scheduled Tasks Code Execution AI
Real-Time File Processing
REST (Direct Function URL or API Gateway)
Event Handling
Scheduling with AWS EventBridge
Ortus Use Case : BoxLang Code Playground : try.boxlang.io
Wanna play?
64MB RAM
600 KB
8 MB
<Your
Code>
Wanna play?
‱ try.boxlang.io
‱ Internet playground for BoxLang
‱ First production BoxLang applications
‱ Powered by our MiniServer and AWS Lambda
Runtimes
Cool Stats
‱ Average executions per day: 32,000+
‱ Average execution time: 32ms
‱ Monthly Bill ????
$0.0000000000
AWS Lambda Best Practices
‱ Code is stateless
‱ Leverage external services: S3, ElastiCache, RDS,
etc.
‱ Ephemeral Disk Capacity
‱ 512MB by default -> 10GB if needed (But you pay)
‱ Max Timeout = 15 Minutes, lower it to your convenience,
or pay for it :)
AWS Lambda Best Practices
‱ Concurrent Executions: 1000
‱ Beware the ColdStart
‱ Use static constructs to avoid re-creations per request
‱ Payload Size (Careful Here)
‱ Request: 6MB Synchronous, 256KB asynchronous
‱ Response: 6MB
Logging & Metrics
‱ USE IT! It’s already included
‱ Enable X-Ray + Lambda Service Traces
‱ Enable Enhanced Monitoring
‱ A wealth of debugging data is available!
Deployment Limits
‱ 50 MB zip or jar
fi
le
‱ 250MB unzipped
‱ Up to 5 Layers (Dependency Jars)
‱ Recommendations:
‱ Create a Fat/Shaded Jar
‱ Use Container Images -> 10GB
‱ Use our BoxLang Template!
‱ But, remember, focused work units is what you want.
Power Levels
‱ Had no idea at
fi
rst!
‱ You don’t choose CPU, you choose the memory
‱ More Memory => More CPU you get
‱ From 128bm => 10GB in 1GB increments
‱ Want to save money?
Choose ARM and not x86, way cheaper!
‱ Geek way to save money?
AWS Lambda Power Tuning: https://github.com/alexcasalboni/aws-lambda-power-tuning
SAM - Your new Best Friend
‱ Template-Driven resource management model
‱ Fancy words for Infrastructure as Code
‱ Supports anything AWS
‱ Included CLI
‱ Great for testing locally
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html
DYNAMIC : MODULAR : PRODUCTIVE
Part 2
BoxLang is a modular dynamic language for the JVM, aiming to
make your development more productive, expressive, functional,
and available everywhere.
DYNAMIC : MODULAR : PRODUCTIVE
Part 2
Multi-Runtime Architecture
Any OS
Docker MiniServer CommandBox Servlet Lambda Azure Android WebAssembly
In Dev Soon Soon
8 MB
9 MB 8 MB
15 MB
15 MB
160 MB
BoxLang Lambda Runtime
BoxLang Lambda Runtime
‱ Leverages the AWS Java SDK
‱ BoxLang implements the AWS Runtime Handler for you
‱ Bootstraps the runtime (Con
fi
gurations + Modules + Dependencies)
‱ Tuned for fast startups
Lambda Flow
‱ Lambda Handler:
‱ ortus.boxlang.runtime.aws.LambdaRunner
:
:
handleRequest
‱ Acts as a Front Controller
‱ Inspects incoming Request
‱ Automatic logging/tracing
‱ Automatic error handling
‱ Delegates to the appropriate BoxLang Class + Function
‱ Automatic response handling
BoxLang Lambda Handler
‱ Implement Handlers as BoxLang Classes
‱ Class by Convention: Lambda.bx
‱ 1 method by convention: run( event, context, response )
‱ 1 Optional Application.bx for life-cycles or activating framework features
BoxLang Handlers
‱ Run() function by convention
‱ Event = Struct of the request
‱ Context = AWS Context Object
‱ Response = Struct of response data (optional)
‱ Return:
‱ Nothing (Use the response struct)
‱ Simple Value
‱ Complex Values
BoxLang Lambda
BoxLang Lambda
‱ A Struct
‱ Lambda Invocation Types
‱ Manual input
‱ Function URL Request
BoxLang Event Struct
https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html
{
"version": "2.0",
"routeKey": "$default",
"rawPath": "/my/path",
"rawQueryString": "parameter1=value1&parameter1=value2&parameter2=value",
"cookies": [
"cookie1",
"cookie2"
],
"headers": {
"header1": "value1",
"header2": "value1,value2"
},
"queryStringParameters": {
"parameter1": "value1,value2",
"parameter2": "value"
},
"requestContext": {
"accountId": "123456789012",
"apiId": "<urlid>",
"authentication": null,
"authorizer": {
"iam": {
"accessKey": "AKIA
.
.
.
",
"accountId": "111122223333",
"callerId": "AIDA
.
.
.
",
"cognitoIdentity": null,
"principalOrgId": null,
"userArn": "arn:aws:iam
:
:
111122223333:user/example-user",
"userId": "AIDA
.
.
.
"
}
},
"domainName": "<url-id>.lambda-url.us-west-2.on.aws",
"domainPrefix": "<url-id>",
"http": {
"method": "POST",
"path": "/my/path",
"protocol": "HTTP/1.1",
"sourceIp": "123.123.123.123",
"userAgent": "agent"
},
"requestId": "id",
"routeKey": "$default",
"stage": "$default",
‱ A Java object
‱ com.amazonaws.services.lambda.runtime.Context
AWS Lambda Context
https://docs.aws.amazon.com/lambda/latest/dg/java-context.html
‱ We build the response object for you according to your return
‱ Return:
‱ Nothing (Use the response struct)
‱ statusCode: numeric
‱ headers: struct
‱ Body: anything
‱ Cookies : array
‱ Simple Value
‱ Complex Values
AWS Lambda Response
‱ Lambda exposed as a URL
‱ Run() function by convention
‱ Add as many public functions as you want
‱ Execute them via the x-bx-function header
‱ Class Routing
‱ `/{ClassName}` -> ClassName.bx : run()
Lambda Multi-Function Routing
BoxLang Lambda Template
‱ Turnkey Template for Lambda Development
‱ Unit + Integration Testing
‱ JUnit/TestBox + SAM
‱ Gradle
‱ Java Dependencies + Packaging + Testing
‱ CommandBox
‱ BoxLang Dependencies
‱ Github Actions CI
‱ Testing -> Packaging -> Deployment
https://github.com/ortus-boxlang/bx-aws-lambda-template
Package
Getting Started
Try Boxlang
An online code playground built on
the MiniServer + AWS Lambda
Runtimes.
Docs
Learn about BoxLang, and contribute
to our extensive documentation.
Community
Join our community and get help,
tips and more.
x.com/tryboxlang
www.boxlang.io
linkedin.com/company/tryboxlang
facebook.com/tryboxlang
youtube.com/ortussolutions
Questions?
THANK YOU

More Related Content

Similar to June Webinar: BoxLang-Dynamic-AWS-Lambda (20)

PPTX
Building self service framework
Rovshan Musayev
 
PDF
AWS Lambda Functions A Comprehensive Guide
Inexture Solutions
 
PDF
Building Dynamic AWS Lambda Applications with BoxLang
Ortus Solutions, Corp
 
PDF
Serverless in Java Lessons learnt
Krzysztof Pawlowski
 
PPTX
Getting started with Serverless on AWS
Adrian Hornsby
 
PDF
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07
Derek Ashmore
 
PDF
Aws Lambda for Java Architects - Illinois VJug -2016-05-03
Derek Ashmore
 
PDF
SoCal NodeJS Meetup 20170215_aws_lambda
Stefan Deusch
 
PDF
The serverless LAMP stack
⛷ Ben Smith
 
PDF
20200520 - Como empezar a desarrollar aplicaciones serverless
Marcia Villalba
 
PPTX
Auto Retweets Using AWS Lambda
CodeOps Technologies LLP
 
PPTX
Scheduled Retweets Using AWS Lambda
Srushith Repakula
 
PDF
Aws Lambda for Java Architects - JavaOne -2016-09-19
Derek Ashmore
 
PDF
Serverless in java Lessons learnt
Krzysztof Pawlowski
 
PPTX
AWS Serverless Computing Introduction Session 2.pptx
krnaween
 
PDF
Aws Lambda for Java Architects CJug-Chicago 2016-08-30
Derek Ashmore
 
PPTX
Containerless in the Cloud with AWS Lambda
Ryan Cuprak
 
PDF
Building Serverless APIs (January 2017)
Julien SIMON
 
PDF
Čtvrtkon #64 - AWS Serverless - Michal HatĂĄk
Ctvrtkoncz
 
PDF
Serverless APIs with JavaScript - Matt Searle - ChocPanda
Paul Dykes
 
Building self service framework
Rovshan Musayev
 
AWS Lambda Functions A Comprehensive Guide
Inexture Solutions
 
Building Dynamic AWS Lambda Applications with BoxLang
Ortus Solutions, Corp
 
Serverless in Java Lessons learnt
Krzysztof Pawlowski
 
Getting started with Serverless on AWS
Adrian Hornsby
 
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07
Derek Ashmore
 
Aws Lambda for Java Architects - Illinois VJug -2016-05-03
Derek Ashmore
 
SoCal NodeJS Meetup 20170215_aws_lambda
Stefan Deusch
 
The serverless LAMP stack
⛷ Ben Smith
 
20200520 - Como empezar a desarrollar aplicaciones serverless
Marcia Villalba
 
Auto Retweets Using AWS Lambda
CodeOps Technologies LLP
 
Scheduled Retweets Using AWS Lambda
Srushith Repakula
 
Aws Lambda for Java Architects - JavaOne -2016-09-19
Derek Ashmore
 
Serverless in java Lessons learnt
Krzysztof Pawlowski
 
AWS Serverless Computing Introduction Session 2.pptx
krnaween
 
Aws Lambda for Java Architects CJug-Chicago 2016-08-30
Derek Ashmore
 
Containerless in the Cloud with AWS Lambda
Ryan Cuprak
 
Building Serverless APIs (January 2017)
Julien SIMON
 
Čtvrtkon #64 - AWS Serverless - Michal HatĂĄk
Ctvrtkoncz
 
Serverless APIs with JavaScript - Matt Searle - ChocPanda
Paul Dykes
 

More from Ortus Solutions, Corp (20)

PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
What's-New-with-BoxLang-Brad Wood.pptx.pdf
Ortus Solutions, Corp
 
PDF
Getting Started with BoxLang - CFCamp 2025.pdf
Ortus Solutions, Corp
 
PDF
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
What's New with BoxLang Led by Brad Wood.pdf
Ortus Solutions, Corp
 
PDF
Vector Databases and the BoxLangCFML Developer.pdf
Ortus Solutions, Corp
 
PDF
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
Ortus Solutions, Corp
 
PDF
Use JSON to Slash Your Database Performance.pdf
Ortus Solutions, Corp
 
PDF
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Ortus Solutions, Corp
 
PDF
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
Ortus Solutions, Corp
 
PDF
Supercharging CommandBox with Let's Encrypt.pdf
Ortus Solutions, Corp
 
PDF
Spice up your site with cool animations using GSAP..pdf
Ortus Solutions, Corp
 
PDF
Passkeys and cbSecurity Led by Eric Peterson.pdf
Ortus Solutions, Corp
 
PDF
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
Ortus Solutions, Corp
 
PDF
Integrating the OpenAI API in Your Coldfusion Apps.pdf
Ortus Solutions, Corp
 
PDF
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
Ortus Solutions, Corp
 
PDF
Geting-started with BoxLang Led By Raymon Camden.pdf
Ortus Solutions, Corp
 
PDF
From Zero to CRUD with ORM - Led by Annette Liskey.pdf
Ortus Solutions, Corp
 
PDF
Customize your Runtime Creating your first BoxLang Module.pdf
Ortus Solutions, Corp
 
PDF
CommandBox WebSockets - and SocketBox.pdf
Ortus Solutions, Corp
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
What's-New-with-BoxLang-Brad Wood.pptx.pdf
Ortus Solutions, Corp
 
Getting Started with BoxLang - CFCamp 2025.pdf
Ortus Solutions, Corp
 
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
Ortus Solutions, Corp
 
What's New with BoxLang Led by Brad Wood.pdf
Ortus Solutions, Corp
 
Vector Databases and the BoxLangCFML Developer.pdf
Ortus Solutions, Corp
 
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
Ortus Solutions, Corp
 
Use JSON to Slash Your Database Performance.pdf
Ortus Solutions, Corp
 
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Ortus Solutions, Corp
 
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
Ortus Solutions, Corp
 
Supercharging CommandBox with Let's Encrypt.pdf
Ortus Solutions, Corp
 
Spice up your site with cool animations using GSAP..pdf
Ortus Solutions, Corp
 
Passkeys and cbSecurity Led by Eric Peterson.pdf
Ortus Solutions, Corp
 
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
Ortus Solutions, Corp
 
Integrating the OpenAI API in Your Coldfusion Apps.pdf
Ortus Solutions, Corp
 
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
Ortus Solutions, Corp
 
Geting-started with BoxLang Led By Raymon Camden.pdf
Ortus Solutions, Corp
 
From Zero to CRUD with ORM - Led by Annette Liskey.pdf
Ortus Solutions, Corp
 
Customize your Runtime Creating your first BoxLang Module.pdf
Ortus Solutions, Corp
 
CommandBox WebSockets - and SocketBox.pdf
Ortus Solutions, Corp
 
Ad

Recently uploaded (20)

PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih KĂŒĂ§ĂŒk
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Dipole Tech Innovations – Global IT Solutions for Business Growth
dipoletechi3
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih KĂŒĂ§ĂŒk
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Dipole Tech Innovations – Global IT Solutions for Business Growth
dipoletechi3
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Ad

June Webinar: BoxLang-Dynamic-AWS-Lambda

  • 1. Dynamic AWS Lambda with LED BY Luis F. Majano
  • 2. LUIS F. MAJANO ‱ CEO Ortus Solutions ‱ Computer Engineer ‱ Born in El Salvador => Raised in the USA ‱ 2023 Leading EU Expansion team (Malaga, Spain đŸ‡Ș🇾) ‱ Creator & Maintainer: ColdBox MVC, TestBox BDD/TDD, CommandBox CLI, ContentBox CMS, etc. ‱ Creator / Chief Language Engineer BoxLang Programming Language @lmajano @ortussolutions
  • 3. ‱ Serverless ‱ What? Why? When? ‱ Providers ‱ Use Cases ‱ Real Life Case ‱ Best Practices Agenda ‱ BoxLang ‱ Lambda Runtime ‱ Lambda Template Part 1 Part 2
  • 4. AWS Lambda - Serverless Computing FaaS
  • 5. AWS Lambda is a serverless computing service that runs code in response to events without managing servers, automatically scaling and charging only for execution time. What is serverless?
  • 6. Serverless Computing Evolution Physical Machines Virtual Machines Containers Lambdas Focus on Business Logic Abstraction
  • 7. Execution Patterns ‱ API Driven Patterns ‱ Event Driven Patterns ‱ Data Streaming Patterns ‱ Scheduling Patterns
  • 8. Key Points about Serverless ‱ Me ‱ Focus on code abstractions ‱ Provider ‱ Auto Scaling ‱ Fault tolerance ‱ High Availability ‱ Metrics and Logging ‱ No OS updates ‱ Pay per use ONLY
  • 9. Fine-Grained Pricing: Never pay for idle ‱ FREE Tier ‱ Buy in 100ms increments ‱ No minimums ‱ No per-device fees ‱ No idle fees
  • 10. How Functions Work Upload Function (CI, Manually) De fi ne Function Triggers (API Calls, Events, Schedules) Function Execution (Stateless, Cold Start, Timeouts)
  • 13. Core Concept of Serverless is 
. Function = Unit of Work
  • 14. Common Use Cases REST Data Processing Chat Bots Amazon Alexa IoT Scheduled Tasks Code Execution AI
  • 16. REST (Direct Function URL or API Gateway)
  • 18. Scheduling with AWS EventBridge
  • 19. Ortus Use Case : BoxLang Code Playground : try.boxlang.io
  • 20. Wanna play? 64MB RAM 600 KB 8 MB <Your Code>
  • 21. Wanna play? ‱ try.boxlang.io ‱ Internet playground for BoxLang ‱ First production BoxLang applications ‱ Powered by our MiniServer and AWS Lambda Runtimes
  • 22. Cool Stats ‱ Average executions per day: 32,000+ ‱ Average execution time: 32ms ‱ Monthly Bill ???? $0.0000000000
  • 23. AWS Lambda Best Practices ‱ Code is stateless ‱ Leverage external services: S3, ElastiCache, RDS, etc. ‱ Ephemeral Disk Capacity ‱ 512MB by default -> 10GB if needed (But you pay) ‱ Max Timeout = 15 Minutes, lower it to your convenience, or pay for it :)
  • 24. AWS Lambda Best Practices ‱ Concurrent Executions: 1000 ‱ Beware the ColdStart ‱ Use static constructs to avoid re-creations per request ‱ Payload Size (Careful Here) ‱ Request: 6MB Synchronous, 256KB asynchronous ‱ Response: 6MB
  • 25. Logging & Metrics ‱ USE IT! It’s already included ‱ Enable X-Ray + Lambda Service Traces ‱ Enable Enhanced Monitoring ‱ A wealth of debugging data is available!
  • 26. Deployment Limits ‱ 50 MB zip or jar fi le ‱ 250MB unzipped ‱ Up to 5 Layers (Dependency Jars) ‱ Recommendations: ‱ Create a Fat/Shaded Jar ‱ Use Container Images -> 10GB ‱ Use our BoxLang Template! ‱ But, remember, focused work units is what you want.
  • 27. Power Levels ‱ Had no idea at fi rst! ‱ You don’t choose CPU, you choose the memory ‱ More Memory => More CPU you get ‱ From 128bm => 10GB in 1GB increments ‱ Want to save money? Choose ARM and not x86, way cheaper! ‱ Geek way to save money? AWS Lambda Power Tuning: https://github.com/alexcasalboni/aws-lambda-power-tuning
  • 28. SAM - Your new Best Friend ‱ Template-Driven resource management model ‱ Fancy words for Infrastructure as Code ‱ Supports anything AWS ‱ Included CLI ‱ Great for testing locally https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html
  • 29. DYNAMIC : MODULAR : PRODUCTIVE Part 2
  • 30. BoxLang is a modular dynamic language for the JVM, aiming to make your development more productive, expressive, functional, and available everywhere. DYNAMIC : MODULAR : PRODUCTIVE Part 2
  • 31. Multi-Runtime Architecture Any OS Docker MiniServer CommandBox Servlet Lambda Azure Android WebAssembly In Dev Soon Soon 8 MB 9 MB 8 MB 15 MB 15 MB 160 MB
  • 33. BoxLang Lambda Runtime ‱ Leverages the AWS Java SDK ‱ BoxLang implements the AWS Runtime Handler for you ‱ Bootstraps the runtime (Con fi gurations + Modules + Dependencies) ‱ Tuned for fast startups
  • 35. ‱ Lambda Handler: ‱ ortus.boxlang.runtime.aws.LambdaRunner : : handleRequest ‱ Acts as a Front Controller ‱ Inspects incoming Request ‱ Automatic logging/tracing ‱ Automatic error handling ‱ Delegates to the appropriate BoxLang Class + Function ‱ Automatic response handling BoxLang Lambda Handler
  • 36. ‱ Implement Handlers as BoxLang Classes ‱ Class by Convention: Lambda.bx ‱ 1 method by convention: run( event, context, response ) ‱ 1 Optional Application.bx for life-cycles or activating framework features BoxLang Handlers
  • 37. ‱ Run() function by convention ‱ Event = Struct of the request ‱ Context = AWS Context Object ‱ Response = Struct of response data (optional) ‱ Return: ‱ Nothing (Use the response struct) ‱ Simple Value ‱ Complex Values BoxLang Lambda
  • 39. ‱ A Struct ‱ Lambda Invocation Types ‱ Manual input ‱ Function URL Request BoxLang Event Struct https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html { "version": "2.0", "routeKey": "$default", "rawPath": "/my/path", "rawQueryString": "parameter1=value1&parameter1=value2&parameter2=value", "cookies": [ "cookie1", "cookie2" ], "headers": { "header1": "value1", "header2": "value1,value2" }, "queryStringParameters": { "parameter1": "value1,value2", "parameter2": "value" }, "requestContext": { "accountId": "123456789012", "apiId": "<urlid>", "authentication": null, "authorizer": { "iam": { "accessKey": "AKIA . . . ", "accountId": "111122223333", "callerId": "AIDA . . . ", "cognitoIdentity": null, "principalOrgId": null, "userArn": "arn:aws:iam : : 111122223333:user/example-user", "userId": "AIDA . . . " } }, "domainName": "<url-id>.lambda-url.us-west-2.on.aws", "domainPrefix": "<url-id>", "http": { "method": "POST", "path": "/my/path", "protocol": "HTTP/1.1", "sourceIp": "123.123.123.123", "userAgent": "agent" }, "requestId": "id", "routeKey": "$default", "stage": "$default",
  • 40. ‱ A Java object ‱ com.amazonaws.services.lambda.runtime.Context AWS Lambda Context https://docs.aws.amazon.com/lambda/latest/dg/java-context.html
  • 41. ‱ We build the response object for you according to your return ‱ Return: ‱ Nothing (Use the response struct) ‱ statusCode: numeric ‱ headers: struct ‱ Body: anything ‱ Cookies : array ‱ Simple Value ‱ Complex Values AWS Lambda Response
  • 42. ‱ Lambda exposed as a URL ‱ Run() function by convention ‱ Add as many public functions as you want ‱ Execute them via the x-bx-function header ‱ Class Routing ‱ `/{ClassName}` -> ClassName.bx : run() Lambda Multi-Function Routing
  • 43. BoxLang Lambda Template ‱ Turnkey Template for Lambda Development ‱ Unit + Integration Testing ‱ JUnit/TestBox + SAM ‱ Gradle ‱ Java Dependencies + Packaging + Testing ‱ CommandBox ‱ BoxLang Dependencies ‱ Github Actions CI ‱ Testing -> Packaging -> Deployment https://github.com/ortus-boxlang/bx-aws-lambda-template
  • 45. Getting Started Try Boxlang An online code playground built on the MiniServer + AWS Lambda Runtimes. Docs Learn about BoxLang, and contribute to our extensive documentation. Community Join our community and get help, tips and more. x.com/tryboxlang www.boxlang.io linkedin.com/company/tryboxlang facebook.com/tryboxlang youtube.com/ortussolutions