AWS Certified Developer – Associate — Question 294
A developer compiles an AWS Lambda function and packages the result as a .zip file. The developer uses the Functions page on the Lambda console to attempt to upload the local packaged .zip file. When pushing the package to Lambda, the console returns the following error:
An error occurred (RequestEntityTooLargeException) when calling the UpdateFunctionCode operation
Which solutions can the developer use to publish the code? (Choose two.)
Answer options
- A. Upload the package to Amazon S3. Use the Functions page on the Lambda console to upload the package from the S3 location.
- B. Create an AWS Support ticket to increase the maximum package size.
- C. Use the update-function-code AWS CLI command. Pass the --publish parameter.
- D. Repackage the Lambda function as a Docker container image. Upload the image to Amazon Elastic Container Registry (Amazon ECR). Create a new Lambda function by using the Lambda console. Reference the image that is deployed to Amazon ECR.
- E. Sign the .zip file digitally. Create a new Lambda function by using the Lambda console. Update the configuration of the new Lambda function to include the Amazon Resource Name (ARN) of the code signing configuration.
Correct answer: A, D
Explanation
The RequestEntityTooLargeException occurs because the deployment package exceeds the 50 MB limit for direct upload to AWS Lambda. To resolve this, developers can upload the .zip file to Amazon S3 (which supports up to 250 MB unzipped) or package the function as a container image and upload it to Amazon ECR, which supports image sizes up to 10 GB. Other methods, like using the CLI directly or requesting a quota increase, do not bypass this hard limit for direct zip uploads.