Setting DOTNET_SHARED_STORE For Function Deployed In CloudFormation #222
-
We are creating a Lambda Layer in codebuild. The command we are using is Then we do a This command emits the warning:
We then deploy the function using CF with a But, in the function's CloudWatch log, we get: The documentation reads as below: The .NET Core runtime in Lambda needs to be configured to look for the NuGet assemblies from the layer. This is done by setting the DOTNET_SHARED_STORE environment variable to the paths of where the runtime package store layer will be extracted. If multiple layers are used with different opt directories then each directory should be added to the environment variable separated by colons. A trailing / is required for the DOTNET_SHARED_STORE .NET Core environment variable. What might we be doing wrong? The other weird part is the error message is We are using Amazon.Lambda.Core Version 2.1.0 The layer manifest has The function failing has no direct reference to |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 6 replies
-
@hounddog22030 Are you referring to the documentation at https://github.com/aws/aws-extensions-for-dotnet-cli/blob/master/docs/Layers.md? As mentioned in the documentation, it specifies that the |
Beta Was this translation helpful? Give feedback.
-
Set the environment variable where? We are already setting an environment variable on the function of DOTNET_SHARED_STORE to /opt/dotnetcore/store/.
We are not using those commands, we are using Let me try to review the full picture:
We haven't even really tried that, we published the layer from codebuild to the Lambda Function Layers store and then attempted step 3 and 4 and got to this spot, so we haven't even attempted pulling the layer as a package using AWS::Lambda::LayerVersion |
Beta Was this translation helpful? Give feedback.
-
In the CloudFormation template are you setting the Layer's arn on the
|
Beta Was this translation helpful? Give feedback.
-
Without know where to post "all" the code for a minimal repo, here's the steps I just did.
Received error message The layer artifact.xml looks correct:
|
Beta Was this translation helpful? Give feedback.
-
This is what I have done, I don't know if I am missing something or there's a bug? Here's some very easy to follow steps to reproduce without having to provide a code sample. These steps are created by following as closely as possible to One Of @normj Posts Most steps can be completed from a command line. There are assumptions about editing
Observed Behavior: Expected Behavior: FYI: The manifest in S3 contains:
|
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
UPDATE:
@hounddog22030 Apologies for the delay.
Looks like you were using incorrect value
net60
for--framework
parameter in yourdotnet lambda publish-layer
command. The correct command isdotnet lambda publish-layer MyLayer --s3-bucket testbucket --framework net6.0 --layer-type runtime-package-store
. I noticed this when runningdotnet lambda list-layers
where it was not showing value forCompatible Runtimes
for the published layer. After correcting the value of--framework
parameter tonet6.0
, it displayed valuedotnet6
forCompatible Runtimes
when usingdotnet lambda list-layers
command.Kindly refer Target frameworks in SDK-style projects for valid TFM values.
After the new version of…