|
2 | 2 |
|
3 | 3 | The Amazon.Lambda.RuntimeSupport package is a .NET Lambda Runtime Interface Client (RIC) for the [Lambda Runtime API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html).
|
4 | 4 | The Lambda Runtime Interface Client allows your runtime to receive requests from and send requests to the Lambda service.
|
5 |
| -It can be used for building .NET Lambda functions as either custom runtimes or container images. |
| 5 | +It can be used for building .NET Lambda functions as either custom runtimes or container images. Starting with the .NET 6 this is also the Lambda rutime client used in managed runtimes. |
6 | 6 |
|
7 | 7 |
|
8 | 8 | ## Container Image support
|
9 | 9 |
|
10 | 10 | AWS provides base images containing all the required components to run your functions packaged as container images on AWS Lambda. Starting with the AWS Lambda .NET 5 base image
|
11 | 11 | Amazon.Lambda.RuntimeSupport is used as the Lambda Runtime Client. The library targets .NET Standard 2.0 and can also be used in earlier versions of .NET Core that support
|
12 |
| -.NET Standard like .NET Core 2.1 and 3.1. |
| 12 | +.NET Standard like 3.1. |
13 | 13 |
|
14 |
| -In the AWS Lambda .NET 5 base image this library is preinstalled into `/var/runtime` directory. .NET Lambda |
| 14 | +In the AWS Lambda .NET base image this library is preinstalled into `/var/runtime` directory. .NET Lambda |
15 | 15 | functions using the base image do not directly interact with this package. Instead they pass in an image command or a Dockerfile `CMD` that indicates the
|
16 | 16 | .NET code to run. The format of that parameter is `<assembly-name>::<full-type-name>::<function-name>`.
|
17 | 17 |
|
18 | 18 | Custom base container images where Amazon.Lambda.RuntimeSupport is not preinstalled the library can be included in the .NET Lambda function code as a class library.
|
19 | 19 | To learn how to build a .NET Lambda function using Amazon.Lambda.RuntimeSupport as a class library checkout the **Using Amazon.Lambda.RuntimeSupport as a class library**
|
20 | 20 | section in this README.
|
21 | 21 |
|
22 |
| -The Dockefile below shows how to build a Lambda function using a custom base image. In this case the base image is Microsoft's .NET 5 runtime image. |
| 22 | +The Dockefile below shows how to build a Lambda function using a custom base image. In this case the base image is Microsoft's .NET 6 runtime image. |
23 | 23 | This Dockerfile copies the .NET Lambda function into the `/var/task` directory
|
24 | 24 | and then uses the dotnet CLI to execute the .NET Lambda project which will initialize the Amazon.Lambda.RuntimeSupport library and start responding to Lambda events.
|
25 | 25 |
|
26 | 26 | ```Dockerfile
|
27 |
| -FROM mcr.microsoft.com/dotnet/runtime:5.0 |
| 27 | +FROM mcr.microsoft.com/dotnet/runtime:6.0 |
28 | 28 |
|
29 | 29 | WORKDIR /var/task
|
30 | 30 |
|
31 |
| -COPY "bin/Release/net5.0/linux-x64/publish" . |
| 31 | +COPY "bin/Release/net6.0/linux-x64/publish" . |
32 | 32 |
|
33 | 33 | ENTRYPOINT ["/usr/bin/dotnet", "exec", "/var/task/LambdaContainerCustomBase.dll"]
|
34 | 34 | ```
|
|
0 commit comments