1

I am creating AWS Lambda functions using the C++ SDK. I create these functions with the following role:

Role Document:

{
  "permissionsBoundary": {},
  "roleName": "my_role",
  "policies": [
    {
      "document": {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": "*"
          }
        ]
      },
      "name": "AmazonS3FullAccess",
      "id": "SOMEID",
      "type": "managed",
      "arn": "arn:aws:iam::aws:policy/AmazonS3FullAccess"
    }
  ],
  "trustedEntities": [
    "lambda.amazonaws.com"
  ]
}

When it comes to permissions that's all I do. My lambda functions is still unable to access S3, though. Why is that?

Do I have to create a policy that lets the lambda function assume my_role?

7
  • Do your buckets have bucket policies with deny statements? Also to confirm you're using Lambda not Lambda@Edge? Commented Jul 12, 2020 at 10:51
  • Have you also validated from the console that policies are attached as expected? Commented Jul 12, 2020 at 10:55
  • @ChrisWilliams No. But when I check via the browser I can see that the my_role is attached. However the permissions are not listed Commented Jul 12, 2020 at 11:02
  • @ChrisWilliams About the S3 Bucket: All policies seem normal. All public access blocked. No other deny statements Commented Jul 12, 2020 at 11:04
  • Right so this will be the cause, do you have the full code of you attaching this? I can't see any examples in this format Commented Jul 12, 2020 at 11:04

1 Answer 1

1

Solution: I was passing the wrong bucket name. The bucket name to an old account, which the function could (obviously) not access.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.