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:
- boto3.resource() - to get the s3 object
- s3.Object() - to get the file stored in s3
- .get()['Body'].read() - to read content of file stored
- .copy(copy_source, destination_key) - to copy data from one folder to another in same S3 bucket
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.