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

'package' command should be able to create deterministic zip archives #195

Open Dreamescaper opened 2 years ago

Dreamescaper commented 2 years ago

We create zip archives for our lambdas using "dotnet lambda package" command, and then use "cdk deploy" to deploy them to our environments. Currently this has an issue - created zip archives contain timestamps, therefore those archives are different for each build, and therefore CDK deploys them each time even if nothing is changed.

As a workaround, currently we provide custom AssetHash (based on archive content), but I'd prefer to remove it.

Describe the Feature

'package' command should produce zip archives with striped timestamps and with consistent order.

Is your Feature Request related to a problem?

Slower CDK deployments.

Describe alternatives you've considered

Custom AssetHash.

Additional Context

This issue was actually solved in CDK itself: https://github.com/aws/aws-cdk/pull/2931 . Probably same approach could be used.


This is a :rocket: Feature Request

ashishdhingra commented 2 years ago

Appears to be a valid feature request. May be introduce a flag to alter this behavior. Needs discussion with the team.

lowkasen commented 8 months ago

+1

lowkasen commented 8 months ago

What is the workaround for this issue?

I currently use: source_code_hash = data.archive_file.zip_file.output_base64sha256

And this doesn't work and updates all the time when I build it