Reputation: 103
I have written a AWS Lambda function using BOTO3 lib to copy object from one folder to another in a S3 bucket. Locally logic is working fine but post deploying to lambda, getting permission error.
S3 functions I am using in my code:
IAM granted permissions to lambda:
"s3:PutObject"
"s3:GetObject",
"s3:ListBucket"
But still no luck. Can someone please tell me what other permissions do I need to grant to Lambda to access S3 for my purpose ? PS: tried looking into list of IAM actions but not able to find the missing one.
Upvotes: 0
Views: 1019
Reputation: 78860
Your Lambda function's timeout is too low for the duration of the S3 calls you are making.
Also, there's typically no need to download an S3 object if all you want to do is copy it from S3 to S3. You are downloading the object and that is adding to your timeout woes. Simply use the client-level copy_object function.
Upvotes: 3