Skip to main content

AWS Lambda .NET Library

---

cdk-constructs: Experimental

The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


This library provides constructs for .NET Lambda functions.

To use this module you will either need to have .NET SDK installed (.NET 6.0 or later) with the AWS Lambda Tools for .NET or Docker installed.

.NET Function

Define a DotNetFunction:

dotnet.DotNetFunction(self, "MyFunction",
    project_dir="src/MyFunction"
)

All other properties of lambda.Function are supported, see also the AWS Lambda construct library.

Custom Runtime and Native AOT

With this construct it is possible to use a custom runtime by setting the runtime to PROVIDED_AL2. This allows you to run unsupported .NET runtime versions like .NET 7.0 or Native AOT. Setting the runtime to PROVIDED_AL2 will instruct CDK and the AWS Lambda Tools for .NET to build your project in a Docker container based of Amazon Linux 2. An example can be found below.

dotnet.DotNetFunction(self, "MyFunction",
    project_dir="src/MyFunction",
    runtime=lambda_.Runtime.PROVIDED_AL2,
    bundling=dotnet.BundlingOptions(
        msbuild_parameters=["/p:PublishAot=true"]
    )
)

Make sure <AssemblyName>bootstrap</AssemblyName> is set in the csproj file as this is required by the custom runtime.

Publishing your application with Native AOT requires you to use the same processor architecture for the Lambda function as for your build environment. Without specification, the construct automatically selects the processor architecture of the machine where CDK is building your project.

Community Extensions

We encourage the development of Community Service Extensions that support advanced features. Here are some useful extensions that we have reviewed:

Please submit a pull request so that we can review your service extension and list it here.

Metadata

Release files for aws-cdk.aws-lambda-dotnet 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws-cdk.aws-lambda-dotnet 0.0.6
File Size Uploaded
aws_cdk_aws_lambda_dotnet-0.0.6.tar.gz 77.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aws-cdk.aws-lambda-dotnet 0.0.6
File Interpreter ABI Platform
aws_cdk.aws_lambda_dotnet-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 154.3 kB

Release files / aws_cdk_aws_lambda_dotnet-0.0.6.tar.gz

Download URL aws_cdk_aws_lambda_dotnet-0.0.6.tar.gz
Size 77.9 kB
Tags Source
SHA-256 checksum
How to use checksums
247e53178ce9d7e76f8f0fffcd7212bc64c094d2382d35b46479db1006592c1e
BLAKE2b-256 checksum
How to use checksums
0804fa7ac8cf72d83cbff60068c7aa8c4fea14169584315440f18278bbf44981
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / aws_cdk.aws_lambda_dotnet-0.0.6-py3-none-any.whl

Download URL aws_cdk.aws_lambda_dotnet-0.0.6-py3-none-any.whl
Size 76.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
587d3a5255527aeb9182b1ec330f0585259138dd2a6a3d596c980daf4e237a92
BLAKE2b-256 checksum
How to use checksums
e4f05703fb3e56e9526e2be79a5f39d5b6540b3b034c53b59cf278ad54f67094
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page