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
- Increased the timeout for lambda function to 5 mins.
- Increased the memory usage limit for lambda function.
- Attached policy "AmazonS3FullAccess" to lambda function IAMRole. Also attached policy "AmazonS3ReadOnlyAccess" to the same role (desperate measures)
- Made the Bucket public for everyone.
- Made sure bucket and function live in same region.
Still no luck, what am I doing wrong here? Thanks