🚀 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.
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
Generated files include: requirements.txt, .gitignore
Directory Structure
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')}!"}
}
{ "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
Deployment Timeline
✅ 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:
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