This might not work in all cases, but if you are receiving the 1 MB error message with regards to a Lambda function sitting in front of a Cloudfront distrubtion, you can go to the Cloudfront distros Behavior tab and add the function there with ARN and version number like this image. You need to replace the all caps letters with your use case. The ARN with version number can be found after publishing the Lambda@Edge function.