aws / aws-extensions-for-dotnet-cli

Extensions to the dotnet CLI to simplify the process of building and publishing .NET Core applications to AWS services
Apache License 2.0
369 stars 86 forks source link

Certain lambda layers result in manifest error #318

Closed baughj closed 1 month ago

baughj commented 1 month ago

Describe the bug

Attempting to deploy a lambda layer without a layer description manifest results in an error:

Amazon Lambda Tools for .NET Core applications (5.10.5)
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet

Inspecting Lambda layers for runtime package store manifests
... arn:aws:lambda:us-east-1:464622532012:layer:dd-trace-dotnet:15: Skipped, does not contain a layer description manifest
... arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Extension:57: Skipped, does not contain a layer description manifest

Same behavior was observed in https://github.com/aws/aws-extensions-for-dotnet-cli/issues/202 but not fixed or addressed. Root cause seems to be: https://github.com/aws/aws-extensions-for-dotnet-cli/blob/006e4bab4e7a22119d21209326d37fbac9a82776/src/Amazon.Lambda.Tools/LambdaUtilities.cs#L551

Expected Behavior

Tooling should just use the layer, since the layers can be added later after creation using aws lambda update-function-configuration (without a similar error).

Current Behavior

Amazon Lambda Tools for .NET Core applications (5.10.5)
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet

Inspecting Lambda layers for runtime package store manifests
... arn:aws:lambda:us-east-1:464622532012:layer:dd-trace-dotnet:15: Skipped, does not contain a layer description manifest
... arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Extension:57: Skipped, does not contain a layer description manifest

Reproduction Steps

Deploy (any) function using the publicly available Datadog layers for .NET eg -fl arn:aws:lambda:us-east-1:464622532012:layer:dd-trace-dotnet:15,arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Extension:57

Possible Solution

I suggest that this be made a warning instead, as the CLI tooling enforces no such requirement.

Additional Information/Context

No response

Targeted .NET platform

.NET 8

CLI extension version

Package Id                                     Version         Commands
------------------------------------------------------------------------------------------
amazon.lambda.testtool-8.0                     0.15.2          dotnet-lambda-test-tool-8.0
amazon.lambda.tools                            5.10.5          dotnet-lambda
aws.codeartifact.nuget.credentialprovider      1.0.1           dotnet-codeartifact-creds
dotnet-ef                                      8.0.2           dotnet-ef
microsoft.dotnet-interactive                   1.0.510102      dotnet-interactive

Environment details (OS name and version, etc.)

Windows 11 (WSL)

normj commented 1 month ago

The Skipped, does not contain a layer description manifest messages should just be informational that we are saying the layer you are using don't have an associated manifest of NuGet packages so it won't be used for trimming out .NET assemblies from the deployment bundle as part of the underlying dotnet publish. It should not be stopping deployment, is that what you are seeing?

baughj commented 1 month ago

No, I think this is just a case of user error re: misunderstanding the output. I had interpreted the message as indicating that the layers would not be used, but they are.

normj commented 1 month ago

Cool, glad everything is working for you.

github-actions[bot] commented 1 month ago

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.