I am getting forbidden error while accessing cross-account s3 buckets, but I am able to access bucket using aws s3 cli.
I have checked the following things:
- I have tested code in June and was working and not changed in the last 4 months.
- Lambda role (not changed in the last 4 months):
{
"Action": "s3:*",
"Resource": [
"*"
],
"Effect": "Allow"
},
- code is working with s3 bucket in the same account.
- in account 2 all list objects, write objects, Read bucket permissions, and Write bucket permissions access is given.
I am able to list bucket contents from aws cli and it's not working with lambda.