terraform-aws-lambda
terraform-aws-lambda copied to clipboard
fix: Issues with content filtering when using patterns
Description
-- ZipContentFilter
logic for patterns that have a single allowed pattern.
Earlier this would include all files.
-- generate_content_hash
also considers the patterns before generating the
hash so that the hash generated matches the content of the zip.
Motivation and Context
- Without using this patch deployments to the same environment from different machines with intermediaries such as pycache cause redeployments.
- This also fixes the surprising behaviour that a pattern of
[ ".*.py$" ]
will also include files that do not match that pattern.
Breaking Changes
Unless someone is relying on the legacy behaviour this should not be a breaking change. It will however cause redeployments because of content hash changes.
How Has This Been Tested?
- [ ] I have updated at least one of the
examples/*
to demonstrate and validate my change(s) - [x] I have tested and validated these changes using one or more of the provided
examples/*
projects
- [x] I have executed
pre-commit run -a
on my pull request