🚀 BCE Lambda Quickstart Guide

Get your first BCE Lambda function running in just a few minutes with our step-by-step guide.

What is BCE Lambda?

BCE Lambda is a serverless compute service that lets you run code without provisioning or managing servers. This guide will walk you through creating, deploying, and testing a simple function.

Tip: New to serverless? Check our core concepts documentation.

1. Install CLI

BCE Lambda requires the CLI installed for local development and deployment.

$ curl -sSL https://bce-lambda.com/install.sh | bash
$ bcl version
                        

This installs the BCE CLI with latest version.

📥

CLI v3.0.0

Verify installation by running bcl version

2. Create Project

Initialize a new project with the BCE template engine.

$ mkdir my-function
$ cd my-function
$ bcl new --lang python3.10
                        
__init__.py template.yml

Generated files include: requirements.txt, .gitignore

Directory Structure

my-function/ ├── handler.py ├── requirements.txt ├── template.yml └── venv/

3. Write Function

Replace the default handler code with your logic. This example uses Python.

def handler(event, context):
    return {
        "statusCode": 200,
        "body": {"message": f"Hello, {event.get('name', 'World')}!"}
    }
                        
Sample Invocation
{
  "name": "Moby"
}

Output:

{"statusCode":200,"body":{"message":"Hello, Moby!"}}
                        

4. Deploy Function

Use the CLI to build and deploy your first BCE Lambda function.

$ bcl deploy my-function
✔ Building
✔ Syncing
✔ Published to prod (us-east-1)
🚀 Deployed: my-function:prod
                        
Status: Succeeded ARN: arn:aws:lambda...

Deployment Timeline

11:23:14 Build Started
11:23:17 Deploying
11:23:20 Completed

✅ Your Function is Live!

Your BCE Lambda function is successfully deployed. You can now invoke it through the API Gateway or directly via the BCE Console.

🔧 Troubleshooting

Error: CLI not found

Solution:

Ensure your PATH includes $HOME/.bcl/bin export PATH=$PATH:$HOME/.bcl/bin

Function returns 502 Gateway Error

Check these items:

  • Verify your handler is returning a proper JSON structure
  • Check the CloudWatch logs using the BCE Console
  • Ensure runtime version matches the language