title: S3 Policy to Allow Lambda
body: <p>I have the following policy on an S3 bucket created with the AWS policy generator to allow a lambda, running with a specific role, access to the files in the bucket.  However, when I execute the Lambda, I get 403 permission denied:</p>
  
  <pre><code>"errorMessage": "Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: &lt;requestId&gt;)",
    "errorType": "com.amazonaws.services.s3.model.AmazonS3Exception",
  </code></pre>
  
  <p>The Policy on the S3 bucket:</p>
  
  <pre><code>{
  "Version": "2012-10-17",
  "Id": "Policy&lt;number&gt;",
  "Statement": [
      {
          "Sid": "Stmt&lt;number&gt;",
          "Effect": "Allow",
          "Principal": {
              "AWS": "arn:aws:iam::&lt;account&gt;:role/&lt;roleName&gt;"
          },
          "Action": "s3:*",
          "Resource": "arn:aws:s3:::&lt;bucketName&gt;/*"
      }
  ]
  }
  </code></pre>
  
  <p>What is wrong with the policy?  The Lamba is running with the role configured in the policy.</p>