# An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: Unzipped size must be smaller than 262144000 bytes

- **ID:** `aws/lambda-s3-zip-extract-failed`
- **Domain:** aws
- **Category:** resource_error
- **Error Code:** `InvalidParameterValueException`
- **Verification:** ai_generated
- **Fix Rate:** 82%

## Root Cause

The Lambda deployment package's unzipped size exceeds the 250 MB unzipped limit, including layers and code.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| AWS Lambda API 2015-03-31 | active | — | — |
| AWS SDK for Python 1.27.0 | active | — | — |
| SAM CLI 1.80.0 | active | — | — |

## Workarounds

1. **Reduce deployment package size by removing unused dependencies. For Python, use a virtual environment and prune with 'pip install --no-deps' for only required packages. Then rebuild and redeploy.** (75% success)
   ```
   Reduce deployment package size by removing unused dependencies. For Python, use a virtual environment and prune with 'pip install --no-deps' for only required packages. Then rebuild and redeploy.
   ```
2. **Use AWS Lambda layers to offload large libraries (e.g., numpy, pandas) from the deployment package. Create a layer with the library, and reference it in the function configuration.** (85% success)
   ```
   Use AWS Lambda layers to offload large libraries (e.g., numpy, pandas) from the deployment package. Create a layer with the library, and reference it in the function configuration.
   ```
3. **Use container image support for Lambda: package your function as a Docker image (up to 10 GB) instead of a .zip file. Example: 'docker build -t myfunction . && aws ecr create-repository --repository-name myfunction && docker push ...'.** (90% success)
   ```
   Use container image support for Lambda: package your function as a Docker image (up to 10 GB) instead of a .zip file. Example: 'docker build -t myfunction . && aws ecr create-repository --repository-name myfunction && docker push ...'.
   ```

## Dead Ends

- **** — Compressing the deployment package more aggressively (e.g., using maximum compression) doesn't reduce the unzipped size, which is what matters for the limit. (90% fail)
- **** — Deleting unnecessary files from the package but still including large libraries (e.g., full Python packages) often fails because the unzipped size remains above 250 MB. (70% fail)
