Can anyone advise on this? I'm trying to access an S3 bucket from a lambda function. I have created the following policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::{{ bucketName }}/*"
]
}
]
}
But this doesn't seems to work. I have got a Assume Role Policy: MalformedPolicyDocument: Has prohibited field Resource.
We can't merge multiple access is the same policy?