dotnet lambda package is not reproducible
See original GitHub issueDescribe the bug
Because dotnet lambda package
does not zero out the mtimes of the files in the zip, the zip file itself constantly changes on every build. This means that even rerunning a build of the same exact commit will lead to a cdk diff.
Expected Behavior
dotnet lambda package
should produce identical results given identical inputs.
Current Behavior
The original mtimes are preserved, so there is always a diff.
Reproduction Steps
- Run
dotnet lambda package
. - Use
cdk deploy
to deploy a stack with that lambda function. - Run
dotnet lambda package
again. - Run
cdk diff
.
Possible Solution
Set all mtimes to zero (or provide a flag for this).
Additional Information/Context
No response
Targeted .NET platform
.NET Core 3.1
CLI extension version
amazon.lambda.tools 4.0.0 dotnet-lambda
Environment details (OS name and version, etc.)
Debian
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
c# - .NET Binaries Missing AWS Lambda
In my case, I use Upload from - .zip features of Lambda. ... That's created an issue. When you upload .zip files, make...
Read more >Error deploying c# .net core aws lambda function
I am trying to deploy a lambda function using .NET Core CLI and am not able to deploy the function. I'm not really...
Read more >Debugging .NET Core AWS Lambda functions using the ...
The best practice is to write repeatable and automated tests to ensure that your functions stay correct as you make changes to them...
Read more >Grinding by Hand: How to Manually Build an ASP.NET Core ...
The package Amazon.Lambda.AspNetCoreServer, along with its dependencies, allows you to host an ASP.NET Core application as a Lambda function ...
Read more >Untitled
Dotnet lambda package not working dotnet-lambda tool is not auto installed · Issue #259 - GitHub Building serverless .NET applications on AWS Lambda...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Regardless of whether you want to consider it a bug or a feature request, the problem is that
dotnet lambda package
is currently incompatible with cdk. And it is incompatible because it does not allow for byte-for-byte reproducible builds (hence the issue title).Probably a duplicate of https://github.com/aws/aws-extensions-for-dotnet-cli/issues/195.