aws-extensions-for-dotnet-cli
aws-extensions-for-dotnet-cli copied to clipboard
dotnet lambda package-ci CodeUri unchanged if hash of project is the same
The SAM Serverless::Function property AutoPublishAlias will attempt to re-deploy a lambda if the CodeUri changes.
The CodeUri produced from
dotnet lambda package-ci
is always different, even if the lambda code doesn't change.
This causes issues deploying changes to the other resources in the SAM template, because if you don't also change the lambda code you get a "A version for this Lambda function exists" error and the stack update rolls back.
Is there a way to set the zip file name in the codeuri to a hash of some sort?
it looks like it's currently re-uploading the artifact entirely, even if it's unchanged. Avoiding this could get a lot of gains:
- fewer uploads - saving time, traffic, and S3 space
- fewer spurious artifacts, which get in the way when digging through version history
- fewer spurious function updates, or CloudFormation updates when nothing else has changed. Unnecessary moving pieces during a deployment cause more risk, and add noise to the event log. Some source changes like testing & documentation won't cause changes to the built artifact.
I'm currently using <Deterministic>True</Deterministic>
in my .csproj files and have verified that the zipfiles match between packaging. It looks like verifying the MD5 sum against the ETag can be used as a heuristic to reduce spurious uploads, although it won't always prevent them.
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.
This is still needed