0

I need to return a lot of data from a lambda over http. It's a slow query for a lot of data and will easily exceed the 30s limit. It's not an option to introduce paging but it's okay to be a long slow request. It needs to be a simple GET endpoint. These requirements are imposed by a third party.

Would it be possible to return a stream of some sort e.g. s3 stream or kinesis stream?

david_adler
  • 9,690
  • 6
  • 57
  • 97
  • What do you mean by a lot of data? – acorbel May 04 '21 at 08:10
  • can't you use a presigned S3 url? The data is stored into S3 and streamed to the end user. If the third party follows an url redirection, you can just return a 302 status code with the S3 presigned url as location. – acorbel May 04 '21 at 10:49
  • yeah that would normally work! The thing is the file needs to be generated on the fly and ideally I don't want to return any redirect status codes. – david_adler May 04 '21 at 10:51
  • You have several issues with Lambda: maximum output (6MB), timeout (APIGW). The invocation type of Lambda (and APIGW) does not allow streaming. – acorbel May 04 '21 at 10:58

0 Answers0