Read what's new in the v0.8.4 "Hicetas" release.
LambdaSharp is a CLI and framework for serverless .NET Core application development on AWS. LambdaSharp uses a simple declarative syntax to generate sophisticated CloudFormation templates that provide simple, yet flexible, deployment options.
The objective of LambdaSharp is to accelerate the development pace of serverless solutions while helping developers adhere consistently to best practices to create scalable, observable, and modular systems.
The LambdaSharp CLI is installed as a .NET Global Tool.
dotnet tool install -g LambdaSharp.Tool
Once installed, a deployment tier must be initialized.
lash init --quick-start
Creating modules with Lambda functions and deploying them only requires a few steps.
# Create a new LambdaSharp module
lash new module MySampleModule
# Add a function to the LambdaSharp module
lash new function MyFunction --type generic
# Deploy the LambdaSharp module
lash deploy
The LambdaSharp CLI uses a YAML file to compile the C# projects, upload artifacts, and deploy the CloudFormation stack in one step. The YAML file describes the entire module including the inputs, outputs, variables, resources, and functions.
Module: MySampleModule
Items:
- Function: MyFunction
Memory: 128
Timeout: 30
The C# project contains the Lambda handler.
namespace MySampleModule.MyFunction {
public class FunctionRequest {
// add request fields
}
public class FunctionResponse {
// add response fields
}
public sealed class Function : ALambdaFunction<FunctionRequest, FunctionResponse> {
//--- Constructors ---
public Function() : base(new LambdaSharp.Serialization.LambdaSystemTextJsonSerializer()) { }
//--- Methods ---
public override Task InitializeAsync(LambdaConfig config)
=> Task.CompletedTask;
public override async Task<FunctionResponse> ProcessMessageAsync(FunctionRequest request) {
// add business logic
return new FunctionResponse();
}
}
}
- Create a Serverless Chat with Cognito, WebSocket, DynamoDB, and Lambda
- Create a Static Website with CloudFormation
- Create Animated GIFs from Videos with AWS Lambda
- Misc. LambdaSharp Samples
- LambdaSharp CLI Reference
- LambdaSharp .NET SDK Reference
- LambdaSharp Syntax Reference
- LambdaSharp Module IAM Short-hands
- Modules
- Resource Types
Copyright (c) 2018-2022 LambdaSharp (λ#)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.