I'm using Kinesis Firehose to copy application logs from CloudWatch Logs into S3 buckets.
- Application logs are written to CloudWatch
- A Kinesis subscription on the log group pulls the log events into a Kinesis stream.
- A firehose delivery stream uses a Lambda function to decompress and transform the source record.
- Firehose writes the transformed record to an S3 destination with GZIP compression enabled.
However, there is a problem with this flow. Often I've noticed that the Lambda transform function fails because the output data exceeds the 6 MiB response payload limit for Lambda synchronous invocation. It makes sense this would happen because the input is compressed but the output is not compressed. Doing it this way seems like the only way to get the file extension and MIME type set correctly on the resultant object in S3.
Is there any way to deliver the input to the Lambda transform function uncompressed?
This would align the input/output sizes. I've already tried reducing the buffer size on the Firehose delivery stream, but the buffer size limit seems to be on compressed data, not raw data.