0
votes

This code works in .net core console on my local machine

await S3Client.GetObjectAsync(new GetObjectRequest { BucketName = bucketName, Key = key });

but same line does not work in Lambda function in aws, it times out with "Task timed out after 30.03 seconds"

I have done following

  1. Increased the timeout for lambda function to 5 mins.
  2. Increased the memory usage limit for lambda function.
  3. Attached policy "AmazonS3FullAccess" to lambda function IAMRole. Also attached policy "AmazonS3ReadOnlyAccess" to the same role (desperate measures)
  4. Made the Bucket public for everyone.
  5. Made sure bucket and function live in same region.

Still no luck, what am I doing wrong here? Thanks