You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# .NET on Linux uses OpenSSL to handle certificates. The .NET runtime will load the certs by first reading
4
+
# the default cert bundle file which can be overriden by the SSL_CERT_FILE env var. Then it will load the
5
+
# certs in the default cert directory which can be overriden by the SSL_CERT_DIR env var. On AL2023
6
+
# The default cert bundle file, via symbolic links, resolves to being in a file under the default cert directory.
7
+
# This means the default cert bundle file is double loaded causing a cold start performance hit. This logic
8
+
# sets the SSL_CERT_FILE to a noop file if SSL_CERT_FILE hasn't been explicitly
9
+
# set. This avoid the double load of the default cert bundle file.
10
+
if [ -z"${SSL_CERT_FILE}"];then
11
+
export SSL_CERT_FILE="/tmp/noop"
12
+
fi
13
+
14
+
# This script is used to locate 2 files in the /var/task folder, where the end-user assembly is located
15
+
# The 2 files are <assembly name>.deps.json and <assembly name>.runtimeconfig.json
16
+
# These files are used to add the end-user assembly into context and make the code reachable to the dotnet process
17
+
# Since the file names are not known in advance, we use this shell script to find the files and pass them to the dotnet process as parameters
18
+
# You can improve cold-start performance by setting the LAMBDA_DOTNET_MAIN_ASSEMBLY environment variable and specifying the assembly name
19
+
# LAMBDA_TASK_ROOT is inherited from the Lambda execution environment/base image as "/var/task", but can be overridden for use in custom images.
20
+
if [ -z"${LAMBDA_TASK_ROOT}" ];then
21
+
echo"Error: Environment variable LAMBDA_TASK_ROOT needs to be defined in order for the Lambda Runtime to load the function handler to be executed."1>&2
22
+
exit 101
23
+
fi
24
+
25
+
if [ !-d"${LAMBDA_TASK_ROOT}" ] | [ -z"$(ls -A ${LAMBDA_TASK_ROOT})" ];then
26
+
echo"Error: .NET binaries for Lambda function are not correctly installed in the ${LAMBDA_TASK_ROOT} directory of the image when the image was built. The ${LAMBDA_TASK_ROOT} directory is missing."1>&2
# Check if there were any matches to the *.deps.json glob, and that the glob was resolved
83
+
# This makes the matching independent from the global `nullopt` shopt's value (https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html)
84
+
if [ "${#DEPS_FILES[@]}"-ne 1 ] ||echo"${DEPS_FILES[0]}"| grep -q -F '*';then
85
+
echo"Error: .NET binaries for Lambda function are not correctly installed in the ${LAMBDA_TASK_ROOT} directory of the image when the image was built. The ${LAMBDA_TASK_ROOT} directory is missing the required .deps.json file."1>&2
# Check if there were any matches to the *.runtimeconfig.json glob, and that the glob was resolved
96
+
# This makes the matching independent from the global `nullopt` shopt's value (https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html)
97
+
if [ "${#RUNTIMECONFIG_FILES[@]}"-ne 1 ] ||echo"${RUNTIMECONFIG_FILES[0]}"| grep -q -F '*';then
98
+
echo"Error: .NET binaries for Lambda function are not correctly installed in the ${LAMBDA_TASK_ROOT} directory of the image when the image was built. The ${LAMBDA_TASK_ROOT} directory is missing the required .runtimeconfig.json file."1>&2
0 commit comments