Lambda: Access denied for Put Object Operation despite S3FullAccess

0

I have a Lambda function that pulls data from an S3 bucket, transforms it and puts it into another bucket. I gave it S3FullAccess, which should include all operations. Loading data is no problem, however when I try to store the transformed data in a new bucket (or even a different folder within the same bucket), the following error message occurs:

"An error occurred (AccessDenied) when calling the PutObject operation: Access Denied"

The following lines both throw the error:

awswrangler.s3.to_csv(joined_df, 's3://buckets/other-bucket/data.csv', index=False)

awswrangler.s3.to_csv(joined_df, 's3://buckets/my-bucket/other-subfolder/data.csv', index=False)

This is, again, despite the Lambda having AmazonS3FullAccess. Does anyone know what is wrong here?

1개 답변
1

Hi THere

If the IAM user has the correct permissions to upload to the bucket, then check the following policies for settings that are preventing the uploads:

IAM user permission to s3:PutObjectAcl
Conditions in the bucket policy
Access allowed by an Amazon Virtual Private Cloud (Amazon VPC) endpoint policy
AWS KMS encryption

See https://aws.amazon.com/premiumsupport/knowledge-center/s3-403-upload-bucket/

profile pictureAWS
전문가
Matt-B
답변함 2년 전
profile pictureAWS
전문가
검토됨 2년 전
  • Thanks for this, I went through these policies but none seem to apply in my case. I specifically created a new policy and role now with "s3:PutObjectAcl" permission, added it to a new role & gave it access through the bucket policy.

    There are no conditions in the bucket policy, VPCs play no role and the bucket is not KMS encrypted. Is there any other possible reason?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠