Feature request: Avoid Archiving Before Uploading Lambda if Already a Zip
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Describe your idea/feature/enhancement
I wish SAM CLI (`sam deploy`) would not package my Serverless function if it's already a ZIP file post `sam build`.
If this already exists (was unable to find a CLI flag that indicated this and it appeared the behavior was to archive my zip file rather than just uploading directly), would love any pointers.
### Proposal
I utilize a Makefile such that `sam build` delegates to a Make target so I can utilize our Python build system (Pants) to be responsible for building Lambda deployments. In this case, Pants will actually build the Zip file and then subsequent builds will be lightning fast given the build cache. The challenge is when it comes to deploys, SAM is actually zipping the already zipped deployment which fails at runtime after deployment. It would be ideal if SAM could avoid this if it detects a Zip file already existing in the artifacts to deploy.
Contributor guide
Research direction
Start by reproducing the sam build and sam deploy flow described in the issue, using the Makefile target to provide a prebuilt ZIP from Pants. Trace where SAM packages the artifact before deployment; done means an already-zipped Lambda artifact is uploaded without being archived again and the deployed function runs correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cli, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100