Returns max of 1000 objects in a bucket with each request.
Solution:
If there are more objects to retrieve, continue making requests until all objects are retrieved by checking for IsTruncated, which will determine if there are more objects to retrieve.
Ref:
API Gateway requests will timeout after 29 sec for lambda invocations which cannot be changed. API gateway will throw 504 timeout error if not responded within 29 secs.
Solution:
- Use asynchronous execution pattern - https://joarleymoraes.com/serverless-long-running-http-requests/
Ref: