Blog

BoxLang Runtime for AWS Lambda!

Maria Jose Herrera June 05, 2024

Spread the word

Maria Jose Herrera

June 05, 2024

Spread the word


Share your thoughts

BoxLang: Announcing Lambda for the Win!

We are excited to introduce the latest addition to our serverless computing toolkit: the BoxLang Runtime for AWS Lambda! This new release enables you to seamlessly run BoxLang functions in AWS Lambda, providing a powerful and flexible way to develop serverless applications.

Please note. We are still in Open Beta, Anything can change.

Learn More

What is AWS Lambda?

AWS Lambda is a serverless computing service from Amazon Web Services (AWS) that lets you run code without provisioning or managing servers. It automatically scales applications by running code that responds to events and allocating compute resources as needed, allowing developers to focus on writing code rather than managing infrastructure. Learn more about AWS Lambda

AWS Lambda

BoxLang Runtime for AWS Lambda

Our new BoxLang AWS Runtime allows you to execute Lambda.bx functions within the AWS Lambda ecosystem. We've also provided a handy template to help you get started with serverless computing using BoxLang.

Key Features

  • Default Lambda Handler: The runtime includes a pre-configured handler that accepts JSON inputs as a BoxLang Struct and outputs either simple or complex objects. The default handler is ortus.boxlang.runtime.aws.LambdaRunner::handleRequest.

Handler Code

  • Environment Variables: Customize your Lambda function with environment variables such as BOXLANG_LAMBDA_CLASS, BOXLANG_LAMBDA_DEBUGMODE, and BOXLANG_LAMBDA_CONFIG.

  • Default Template: Our default template is a Gradle project designed to streamline your development process. It includes everything from VSCode tasks to AWS Lambda utilities.

Review Template

Getting Started

  1. Download the Runtime:

    shellCopy code
    ./gradlew downloadBoxLang
    
    
  2. Run Tests:

    shellCopy code
    ./gradlew test
    
    
  3. Build the Project:

    shellCopy code
    ./gradlew build
    
    

Learn More

Example Lambda Function

Here's a simple example of a Lambda.bx function:

boxlangCopy code
class{
    function run( event, context, response ){
        response.body = {
            "error": false,
            "messages": [],
            "data": "====> Incoming event " & event.toString()
        };
        response.statusCode = 200;
    }
}

Get Started

Deploying to AWS

  1. Create a Function: Log in to the Lambda Console and click on "Create function".
  2. Configure the Function: Add a function name, choose Java 21 as the runtime, and select x86_64 as the architecture.
  3. Upload Code: Upload your code as a zip/jar or from an S3 location.
  4. Set the Handler: Use ortus.boxlang.runtime.aws.LambdaRunner::handleRequest as the handler.
  5. Test Your Function: Use the Test tab to create an event and test your function.

Deploy to AWS

Contribute and Explore

The source code for the AWS Runtime is available HERE. We welcome contributions, testing, and documentation improvements.

AWS Runtime

Get started with the BoxLang Runtime for AWS Lambda today and unlock the potential of serverless computing! Visit our GitHub repository for more details and to get started.

Happy coding!

Add Your Comment

Recent Entries

BoxLang 1.0.0 Beta 7 Launched

BoxLang 1.0.0 Beta 7 Launched

We are pleased to announce the release of BoxLang 1.0.0-Beta 7! This latest beta version includes improvements and essential bug fixes, but more importantly it certifies the execution of ColdBox HMVC and TestBox.

What is BoxLang?

BoxLang is a modern dynamic JVM language that can be deployed on multiple runtimes: operating system (Windows/Mac/*nix/Embedded), web server, lambda, iOS, android, web assembly, and more. BoxLang combines many features from different progr

Luis Majano
Luis Majano
July 26, 2024
New BoxLang Feature: Java Method References and Higher-Order Functions

New BoxLang Feature: Java Method References and Higher-Order Functions

We’ve added more goodies to our BoxLang Java interop: method references and higher-order functions. CFML has never let you do these things, making Java Interop feel like a second-class citizen. But with BoxLang, we’re elevating Java integration to a new level.

Maria Jose Herrera
Maria Jose Herrera
July 26, 2024
Level Up Your ColdFusion Skills with our Virtual Live Training: ColdBox from Zero to Hero

Level Up Your ColdFusion Skills with our Virtual Live Training: ColdBox from Zero to Hero

Level Up Your ColdFusion Skills with our Virtual Live Training: ColdBox from Zero to Hero

Are you a CFML developer looking to take your skills to the next level? Look no further than the ColdBox from Zero to Hero Virtual Live Training! This intensive two-day course will equip you with the knowledge and expertise to build robust and scalable applications using ColdBox 7, the latest version of the most popular CFML MVC framework.

What You'll Learn:

  • Master the Fun...

Cristobal Escobar
Cristobal Escobar
July 24, 2024