What is a deployment package in serverless?

Answer

A deployment package is the artifact uploaded to the cloud provider containing your function code and its dependencies. For AWS Lambda, there are two formats: (1) ZIP archive — your function code + node_modules (Node.js) or virtual environment packages (Python) zipped together. Limits: 50MB zipped when uploading directly, 250MB unzipped from S3; (2) Container image — a Docker image published to Amazon ECR (Elastic Container Registry). Lambda pulls and runs the image. Limit: 10GB uncompressed. Best practices for ZIP packages: exclude dev dependencies (npm prune --production), exclude unnecessary files (.gitignore-style exclusions in serverless.yml), use Lambda Layers for shared dependencies (SDK, common utilities) to avoid bundling them in every function. Smaller packages reduce cold start time and deployment duration. Native binaries (compiled C libraries) must match Lambda's Amazon Linux 2 runtime environment.